Closed hamidbsd closed 4 years ago
is the tns-core-modules deprecated at version 6.x.x?
I am getting this too.
@hamidbsd @davecoffin @atchaiecommerce this was indeed a bug that is addressed in the latest tns-core-modules
. To resolve the issue either update to ``tns-core-modules version 6.3.1 or downgrade to version 6.2.0.
@NickIliev thanks for weighing in! I tried to pin to 6.2.0 but i still get the error.
I removed tns-core-modules and nativescript-angular from my deps, was that the right move?
"@nativescript/angular": "8.20.0",
"@nativescript/core": "6.2.0",
I am running the 6.3 cli, would that also cause a problem?
In other news, I tried upgrading to 6.3.1 by removing @nativescript/angular and @nativescript/core from my deps, and adding this:
"nativescript-angular": "8.20.3",
"tns-core-modules": "6.3.1",
but now I get this error:
ERROR in Cannot determine the module for class TextValueAccessor in /Users/davecoffin/Develop/presonus/mypxplat/apps/nativescript-myp/node_modules/nativescript-angular/node_modules/@nativescript/angular/forms/value-accessors/text-value-accessor.d.ts! Add TextValueAccessor to the NgModule to fix it.
Cannot determine the module for class CheckedValueAccessor in /Users/davecoffin/Develop/presonus/mypxplat/apps/nativescript-myp/node_modules/nativescript-angular/node_modules/@nativescript/angular/forms/value-accessors/checked-value-accessor.d.ts! Add CheckedValueAccessor to the NgModule to fix it.
Cannot determine the module for class DateValueAccessor in /Users/davecoffin/Develop/presonus/mypxplat/apps/nativescript-myp/node_modules/nativescript-angular/node_modules/@nativescript/angular/forms/value-accessors/date-value-accessor.d.ts! Add DateValueAccessor to the NgModule to fix it.
Cannot determine the module for class TimeValueAccessor in /Users/davecoffin/Develop/presonus/mypxplat/apps/nativescript-myp/node_modules/nativescript-angular/node_modules/@nativescript/angular/forms/value-accessors/time-value-accessor.d.ts! Add TimeValueAccessor to the NgModule to fix it.
Cannot determine the module for class NumberValueAccessor in /Users/davecoffin/Develop/presonus/mypxplat/apps/nativescript-myp/node_modules/nativescript-angular/node_modules/@nativescript/angular/forms/value-accessors/number-value-accessor.d.ts! Add NumberValueAccessor to the NgModule to fix it.
Cannot determine the module for class SelectedIndexValueAccessor in /Users/davecoffin/Develop/presonus/mypxplat/apps/nativescript-myp/node_modules/nativescript-angular/node_modules/@nativescript/angular/forms/value-accessors/selectedIndex-value-accessor.d.ts! Add SelectedIndexValueAccessor to the NgModule to fix it.
Executing webpack failed with exit code 2.
ok i finally got this figured out by upgrading to 6.3.1, removing @nativescript/core
and @nativescript/angular
from my deps and going back to nativescript-angular
and tns-core-modules
and switching all my imports back to tns-core-modules
and nativescript-angular
But I guess my question @NickIliev is...how can i use the @nativescript/core
and @nativescript/angular
barrels?
I spoke too soon, it built but when running using aot i get this error when the app launched:
CONSOLE ERROR [native code]: ERROR Error: No component factory found for DetachedLoader. Did you add it to @NgModule.entryComponents?
ok i resolved this finally but am not entirely sure how haha. reminds me of this effort: http://davecoffin.com/blog/11-16-17-how-i-got-webpack-to-work
a word of warning: dont import both tns-core-modules
and @nativescript/core
.
@NickIliev , this is still a problem, even with the latest 6.3 packages. I just created a brand new NG app replaced all the deps to the scoped packages. Running w/o AoT compiles and runs the app just fine. Enabling AoT throws the error in the OP 😞
@PeterStaev are you importing @nativescript/core
or tns-core-modules
?
@davecoffin , this is happening with a brand new project created with the 6.3 CLI that had all references updated to use the scoped packages. So there is no tns-core-modules
anywhere in the project.
right, so i think this may be a problem with importing @nativescript/core
in your dependencies and not tns-core-modules
. They should be interchangeable, try removing @nativescript/core
and adding tns-core-modules
and see if you still see the error. Not saying thats a fix but could point @NickIliev to the solution.
@PeterStaev To be clear, keep importing from the barrel everywhere, just change to tns-core-modules: 6.3.1
in package.json
So we still have to have BOTH @nativescript/core
and tns-core-modules
as deps? I thought this was supposed to be fixed in 6.3 already?
It will probably work (since the files will be there), but this defies the purpose/usage of the scoped packages.
This is not a production app, but a demo app for one of my plugins, so wont do anything. I already wrote in the release that there is a known issue and users will get an error if they use AoT and linked to this issue, so it is all in the hands of the NS Core Team 🙃
Actually you cant have both as deps, because each pulls in tns-core-modules-widgets, so if you have both you get an error that TNSWidget is created in two places. @NickIliev The generated projects should probably be using the scoped imports, that would certainly point out any issues with them a lot faster.
Hi guys,
Thanks for your investigation and sorry for the late response. We've merged a fix in the nativescript-dev-webpack
repository. You could give it a try by installing nativescript-dev-webpack@rc
.
@davecoffin you can use both tns-core-modules
and @nativescript/core
, just keep them with the same version and the tns-core-modules-widgets
package will be deduped by npm
.
Fix released with nativescript-dev-webpack@1.4.1
It fails with nativescript-dev-webpack@1.5.1
@dtopuzov do you know what might be the cause? I am using NativeScript Angular 8.20.0, and the latest CLI with the latest 6.x version of NativeScript.
@diegovincent - please open a new issue; with the entire bug info filled out. Hard to know why with no information. Please also read: https://nativescript.org/blog/nativescript-6-7-xcode-compatibility/ as this could also be part of your failure.
Environment {N} 6.2
Describe the bug Webpack compilation breaks with the following error
Expected behavior To compile without any problems
Additional context This file is causing the problem as it still tries to import from tns-core-modules instead of @nativescript/core. https://github.com/NativeScript/nativescript-angular/blob/87c8cea84b878e2e7b8707e3e7ff7a21bfdd2090/nativescript-angular/platform-providers.ts#L3-L6