Closed
Description
Environment
Provide version numbers for the following components (information can be retrieved by running tns info
in your project folder or by inspecting the package.json
of the project):
- CLI: 5.0.0-2018-10-11-12463
- Cross-platform modules: rc
Describe the bug
If the version of some plugin in the package.json is specified with tag (f.e. rc
) instead of version (f.e. 5.0.0
), the tns preview
command fails with:
TypeError: Cannot read property 'major' of null
at PreviewAppPluginsService.getWarningForPluginCore (/home/sis0k0/nativescript-cli/lib/services/livesync/playground/preview-app-plugins-service.ts:82:30)
The PreviewAppPluginsService
uses semver
to check some stuff with the versions of the plugins in the package.json. However, semver.coerce('rc')
returns null
and breaks the following logic.
To Reproduce
- Create a hello-world app.
- Add this dependency to your package.json:
...
"dependencies": {
"tns-core-modules": "rc",
...
}
- Run
tns preview
and scan the barcode.
Expected behavior
To ignore the above check if the tag is beta
, rc
or next
.
I can submit a PR if you agree that's the correct behaviour.