Error: StaticInjectorError(t)[t -> function(){}]:

Đang mở
#95 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
20/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
angular, typescript
Lĩnh vực
frontend, testing

Hướng nghiên cứu

Đọc page1.spec.ts và cấu hình kiểm thử được sử dụng bởi ví dụ Ionic Karma/Jasmine, sau đó tái hiện bài kiểm thử signup phát ra StaticInjectorError và NullInjectorError. Truy vết provider còn thiếu từ lỗi được báo cáo và so sánh với cấu hình kiểm thử đang hoạt động; hoàn tất khi bài kiểm thử chạy mà không gặp lỗi injector này.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

wrote same code as in page1.spec.ts still getting this error.

Error: StaticInjectorError(t)[t -> function(){}]:
StaticInjectorError(Platform: core)[t -> function(){}]:
NullInjectorError: No provider for function(){}!
error properties: Object({ ngTempTokenPath: null, ngTokenPath: [ 't', Function ], ngDebugContext: t({ view: Object({ def: Object({ factory: Function, nodeFlags: 33669121, rootNodeFlags: 33554433, nodeMatchedQueries: 0, flags: 0, nodes: [ Object({ nodeIndex: 0, parent: null, renderParent: null, bindingIndex: 0, outputIndex: 0, checkIndex: 0, flags: 33554433, childFlags: 114688, directChildFlags: 114688, childMatchedQueries: 0, matchedQueries: Object({ }), matchedQueryIds: 0, references: Object({ }), ngContentIndex: null, childCount: 1, bindings: [ ], bindingFlags: 0, outputs: [ ], element: Object({ ns: '', name: 'signup', attrs: [ ], template: null, componentProvider: Object({ nodeIndex: 1, parent: , renderParent: , bindingIndex: 0, outputIndex: 0, checkIndex: 1, flags: 114688, childFlags: 0, directChildFlags: 0, childMatchedQueries: 0, matchedQueries: Object, matchedQueryIds: 0, references: Object, ngContentIndex: -1, childCount: 0, bindings: ...
at t.get (webpack:///node_modules/@angular/core/esm5/core.js:1003 <- test-config/karma-test-shim.js:45:142)
at webpack:///node_modules/@angular/core/esm5/core.js:1301 <- test-config/karma-test-shim.js:52:2444
at yt (webpack:///node_modules/@angular/core/esm5/core.js:1243 <- test-config/karma-test-shim.js:52:2462)
at t.get (webpack:///node_modules/@angular/core/esm5/core.js:1111 <- test-config/karma-test-shim.js:52:1621) at webpack:///node_modules/@angular/core/esm5/core.js:1301 <- test-config/karma-test-shim.js:52:2444
at yt (webpack:///node_modules/@angular/core/esm5/core.js:1243 <- test-config/karma-test-shim.js:52:2462)
at t.get (webpack:///node_modules/@angular/core/esm5/core.js:1111 <- test-config/karma-test-shim.js:52:1621) at hi (webpack:///node_modules/@angular/core/esm5/core.js:10896 <- test-config/karma-test-shim.js:298:683)

Ngôn ngữ chính
TypeScript
Star
370
Fork
144
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ionic-team/ionic-unit-testing-example

Tất cả issue của ionic-team/ionic-unit-testing-example

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.