This repository was archived by the owner on Aug 7, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
Reflect Metadata issue - DI error when build with nativescript-dev-webpack@next - Can't resolve all parameters for Component #660
Copy link
Copy link
Closed
Labels
backlogbugnextThe problem is only with a prerelease version.The problem is only with a prerelease version.
Description
The issue occurs only when building with next modules, angular and webpack. The CLI build is working as expected while the Webpack build is failing with dependency injection error. The issue is also not reproducible with the master branch.
Steps to reproduce:
- Use this branch from the POC app (tns-core-modules, nativescript-angular and nativescript-dev-webpack set to
next) - Build with
tns run android --bundle
Error log
Error: Can't resolve all parameters for LoginComponent: (?, ?, ?, ?).
System.err: File: "file:///data/data/org.nativescript.curiosity/files/app/vendor.js, line: 19242, column: 12
System.err:
System.err: StackTrace:
System.err: Frame: function:'ZoneAwareError', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 66399, column: 33
System.err: Frame: function:'syntaxError', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 9153, column: 17
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver._getDependenciesMetadata', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 19054, column: 35
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver._getTypeMetadata', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 18947, column: 26
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.getNonNormalizedDirectiveMetadata', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 18566, column: 24
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver._getEntryComponentMetadata', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 19150, column: 28
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 19141, column: 31
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver._getEntryComponentsFromProvider', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 19140, column: 30
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 19113, column: 138
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver._getProvidersMetadata', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 19076, column: 19
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 19078, column: 23
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver._getProvidersMetadata', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 19076, column: 19
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 18699, column: 118
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.getNgModuleMetadata', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 18690, column: 49
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.getNgModuleSummary', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 18625, column: 35
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 18712, column: 55
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.getNgModuleMetadata', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 18690, column: 49
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._loadModules', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 32008, column: 51
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 31989, column: 36
System.err: Frame: function:'push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler.compileModuleAsync', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 31949, column: 37
System.err: Frame: function:'push.../node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js.CompilerImpl.compileModuleAsync', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 51976, column: 31
System.err: Frame: function:'push.../node_modules/@angular/core/fesm5/core.js.PlatformRef.bootstrapModule', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 37439, column: 25
System.err: Frame: function:'_bootstrapper', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 62152, column: 66
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 62209, column: 19
System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 88956, column: 23
System.err: Frame: function:'notifyLaunch', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 106608, column: 17
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 106541, column: 28
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 106415, column: 14
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/activity.js.NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.curiosity/files/app/vendor.js', line: 104505, column: 25
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
backlogbugnextThe problem is only with a prerelease version.The problem is only with a prerelease version.
Activity
NickIliev commentedon Sep 18, 2018
Reverting
nativescript-angular(but still using next webpack and next modules). to 6.1.0 resolves the issueUpdate: reverting the changes from this commit seems to resolve the issue.
NickIliev commentedon Sep 19, 2018
The issue is happening only in JIT and not when using AOT.
Solution:
Manually importing the
reflect-metadataplugin at the top ofmain.tsfile is resolving the issuemain.ts
[-]DI error when build with nativescript-dev-webpack@next - Can't resolve all parameters for Component[/-][+]Reflect Metadata issue - DI error when build with nativescript-dev-webpack@next - Can't resolve all parameters for Component[/+]vchimev commentedon Jan 16, 2019
Fixed by: NativeScript/nativescript-angular#1530.