Skip to content
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

Crash for missing module at runtime after upgrade #947

Closed
rosen-vladimirov opened this issue Sep 19, 2015 · 0 comments
Closed

Crash for missing module at runtime after upgrade #947

rosen-vladimirov opened this issue Sep 19, 2015 · 0 comments
Assignees
Labels
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

Description of the problem

I have a working app, that uses android 1.2.0 and ios 1.2.0. I've downloaded latest CLI (1.3.0) and I've decided to upgrade the runtimes. I prefer clean add, so I deleted node_modules and used the sequence:

tns platform remove android
tns platform add android

After that I built my app (after adding all new requirements) and after deploying on device/emulator, the application crashes that a module is missing.
I've checked the platforms/android directory and there's no tns_modules directory anywhere in the project. Also during build process I see warning that I have "tns_modules" directory under app dir, but it will not be used.

The Reason for the problem

With nativescript-cli 1.3.0, tns_modules directory should not be under app dir in your project. The modules are npm package called tns-core-modules. If you create new project with nativescript-cli 1.3.0 or later, you'll see tns-core-modules as dependency in the package.json of the project. For older projects, the modules are not added automatically and also the modules from app/tns_modules are not used.

Workarounds

First possible workaround is to add manually tns-core-modules in your package.json. You can execute:
npm install --save tns-core-modules
in the root of your project.

The other option is to create a new project, based on your existing one:

tns create newApp --copyFrom pathToOldApp

Possible solutions of the problem

Maybe CLI should add the tns-core-modules in package.json automatically. Another option is to use the modules from app/tns_modules in case there's no tns-core-modules defined in package.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants