-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Protect against runtimePackage.version
returning null
#5444
Comments
Followed it a bit further, but haven't put any debug in yet.
So things could be going wrong either in nativescript-cli/lib/services/project-data-service.ts Lines 567 to 655 in 6de0c3e
|
Getting closer. It strictly expects the runtimes to be in devDependencies. Why is that? nativescript-cli/lib/services/project-data-service.ts Lines 602 to 616 in 6de0c3e
Moving them into devDependencies, my error is now refreshingly different:
This is pretty fragile. Now I see why the plugin seed doesn't hoist dependencies. Could we not have CLI find the version more robustly, e.g. by doing proper node module resolution and utilising the filesystem instead? By fixing this, we'd likely become able to hoist the runtime dependencies in monorepos, saving many megabytes for everyone. |
@shirakaba just stumbled upon this and wanted to react on your point about saving data with monorepo. |
Environment
Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):tns info
andtns doctor
say "is not installed")Describe the bug
Build-time error, as documented fully, along with my environment setup, here: #4451 (comment)
In a demo app made from the official NativeScript plugin seed, whenever I run
tns plugin add ../../dist/packages/my-cool-plugin
on my demo app, I get the nondescript error:... with no stack trace. I determined that this was from the semver package, as it was in the previous issue. Here's the output of a
console.trace()
a line before the thrown error:As I document in this comment, I think the root of the problem is that CLI can't find
@nativescript/android
even though I have it installed. Thus,runtimePackage
returns{ name: '@nativescript/android', version: null }
here:nativescript-cli/lib/services/plugins-service.ts
Line 805 in 6de0c3e
To Reproduce
From a demo project in the official NativeScript plugin seed, run
tns plugin add ../../dist/packages/my-cool-plugin
.I'm not confident that it will reproduce for users with different environments to my own, however.
Expected behavior
Plugin should install successfully and no error should be thrown at all. If an error is thrown, at least a stack trace should be presented. Above all, CLI needs to be able to find
@nativescript/android
when it is clearly present innode_modules
.Sample project
Any project using the plugin seed.
Additional context
The text was updated successfully, but these errors were encountered: