Open tr1et opened 4 years ago
Not a solution, but just an observation: I get the same error in a similar environment but only when actively opting out of Ivy
Toggling
"angularCompilerOptions": {
"enableIvy": false
},
to true
results in a successful compile for me.
@timdoege , sadly some libraries the project is using don't support Ivy yet so I can't enable Ivy now (nativescript-accordion, nativescript-ngx-shadow)
I am having similar issue as below with NativeScriptRouterModule.
ERROR in Unexpected value 'NativeScriptRouterModule in /Users/heena/projects/mobile-app/node_modules/@nativescript/angular/nativescript-angular.d.ts' imported by the module 'AppModule in /Users/heena/projects/mobile-app/src/app/app.module.ts'. Please add a @NgModule annotation.
and same as above I can't set enableIvy to true as used nativescript-ui-charts and such other plugins in project. I tried setting it as true then code sharing stops working.
Class is using Angular features but is not decorated. Please add an explicit Angular decorator. Executing webpack failed with exit code 2.
I am having the same issue regarding the NativeScriptHttpClientModule:
Compiling TypeScript sources through NGC
ERROR: Unexpected value 'NativeScriptHttpClientModule in /Users/radu_nicoara/workspace/smartcomponent-library-nativescript/node_modules/@nativescript/angular/nativescript-angular.d.ts' imported by the module 'SmartComponentsCoreModule in /Users/radu_nicoara/workspace/smartcomponent-library-nativescript/src/core/smart-components.core.module.ts'. Please add a @NgModule annotation.
An unhandled exception occurred: Unexpected value 'NativeScriptHttpClientModule in /Users/radu_nicoara/workspace/smartcomponent-library-nativescript/node_modules/@nativescript/angular/nativescript-angular.d.ts' imported by the module 'SmartComponentsCoreModule in /Users/radu_nicoara/workspace/smartcomponent-library-nativescript/src/core/smart-components.core.module.ts'. Please add a @NgModule annotation.
I am also setting "enableIvy": false
. This issue does not occur when I enable Ivy, however that is not an option because I am building a library. Enabling Ivy for library packages is in my case not possible, as it breaks the builds of consuming applications.
My Angular/NativeScript dependencies:
"@angular/animations": "~11.0.0",
"@angular/common": "~11.0.0",
"@angular/compiler": "~11.0.0",
"@angular/compiler-cli": "~11.0.0",
"@angular/core": "~11.0.0",
"@angular/forms": "~11.0.0",
"@angular/platform-browser": "~11.0.0",
"@angular/platform-browser-dynamic": "~11.0.0",
"@angular/router": "~11.0.0",
"@nativescript/angular": "~11.0.0",
"@nativescript/core": "~7.1.0",
"@nativescript/theme": "~3.0.0",
"@nativescript/types": "~7.0.0",
"@nativescript/webpack": "~4.0.0",
"nativescript-ui-autocomplete": "^7.0.2",
"nativescript-ui-calendar": "^7.0.2",
"nativescript-ui-dataform": "^7.0.4",
"nativescript-ui-listview": "^9.1.0",
@radu2501 Ivy cannot be disabled in latest angular. Try with these deps:
"@angular/animations": "~11.1.0",
"@angular/common": "~11.1.0",
"@angular/compiler": "~11.1.0",
"@angular/compiler-cli": "~11.1.0",
"@angular/core": "~11.1.0",
"@angular/forms": "~11.1.0",
"@angular/platform-browser": "~11.1.0",
"@angular/platform-browser-dynamic": "~11.10",
"@angular/router": "~11.1.0",
"@nativescript/angular": "~11.0.0",
"@nativescript/core": "~7.1.0",
"@nativescript/theme": "~3.0.0",
"@nativescript/types": "~7.1.0",
"@nativescript/webpack": "~3.0.0",
"nativescript-ui-autocomplete": "^7.0.2",
"nativescript-ui-calendar": "^7.0.2",
"nativescript-ui-dataform": "^7.0.4",
"nativescript-ui-listview": "^9.1.0",
Also make sure no @nativescript/angular/deep-path
imports exists... all should be using @nativescript/angular
everywhere in your codebase only.
Also make sure npm i -g nativescript
- using latest cli.
Also confirm Xcode 12.3 or 12.4 is in use.
Then: ns clean
And give it a run.
Environment
Describe the bug
Issues:
To Reproduce
tns clean
tns platform add android
tns prepare android
tns prepare android
failed, got an error:Expected behavior
tns prepare android
successtns run android
Sample project
N/A
Additional context
xplat/nativescript/core/core.module.ts
apps/nativescript-app/tsconfig.json
: