-
-
Notifications
You must be signed in to change notification settings - Fork 241
Dependency on tns-core-modules #2102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@dmytro-gokun for backward compatibility the latest Can you provide more information about your project like the content of your |
@NickIliev You are absolutely right that "the scoped Angular package should work as expected with both the scoped modules and the compatibility package". But my understanding is that it should not require both. If I already have "@nativescript/core" in my package.json, it should not require me to have "tns-core-modules" as well. But it does exactly that. As soon as i remove ""tns-core-modules" from package.json, i'm getting the error above. The easiest way to reproduce is to create a new Angular app using Nativescript CLI and change package.json to use scoped packages instead of 'classic' ones (and repalce 'nativescript-angular' imports with '@nativescript/angular'). So
instead of
If you then attempt to build the app, you will get the error above. Plz check the attached zip file for the reproduction project. |
@dmytro-gokun thanks for the clarification - indeed I can confirm that the behavior is not expected so marking the issue as a big. Probably related to this one as well. |
@dmytro-gokun on second thought the issue you are dealing with should be resolved. I've tested the provided project on my side (with the latest CLI) and the project is building as expected (with However,, you had some scoped imports that needed to be fixed in your project. For example: app.module.ts // WRONG import
import { NativeScriptModule } from "@nativescript/angular; Should become // OK
import { NativeScriptModule } from "@nativescript/angular/nativescript.module"; and in main.ts // WRONG IMPORT
import { platformNativeScriptDynamic } from "@nativescript/angular"; should become import { platformNativeScriptDynamic } from "@nativescript/angular/platform"; |
Try actually building it and not just running.
Well, you know better, that's true. But i thought that one of the objectives of scoped modules was that you did not have to drill down into the package's guts in order to import things. Am I wrong? Also, if importing stuff from "@nativescript/angular" is incorrect, it should not compile telling there is no such symbol to import. Otherwise, this will confuse users and produce lots of questions like this one. |
Please try updating your |
@lini That's helped. Thanks! |
I have the same issue on |
@nativescript/angular 8.20.3 has dependency on tns-core-modules. Is not it supposed to depend only on the scoped package (@nativescript/core)?
The compilation error is:
The text was updated successfully, but these errors were encountered: