Skip to content

Unable to apply changes on device: emulator-XXXX. Error is: Cannot read property 'env' of undefined #4751

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

Closed
NickIliev opened this issue Jun 21, 2019 · 4 comments

Comments

@NickIliev
Copy link
Contributor

@shineklbm commented on Thu Jun 20 2019

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.4.2
  • Cross-platform modules:5.4.2
  • Android Runtime:5.4.0
  • iOS Runtime:5.4.2
  • Plugin(s): "nativescript-ui-sidedrawer": "^4.3.0", "nativescript-plugin-firebase": "^7.7.0", "nativescript-downloader": "^2.1.4",

Describe the bug
After upgrading upgrading the project, when I run, tns run android --bundle or tns run ios --bundle, I am getting Unable to apply changes on device: emulator-XXXX. Error is: Cannot read property 'env' of undefined.

To Reproduce
npm install -g nativescript
tns update
tns run android --bundle
tns run ios --bundle

Expected behavior
It should run the app inside emulator.


@keithgulbro commented on Thu Jun 20 2019

@shineklbm I had the same issue, here's an a vue reference I found vuejs/vue-cli#4177

If you're using Nativescript-Vue CLI like I am, it seems there's some major issues that arose over the last 24 hours.

@shineklbm
Copy link

any update here? I am still getting this error

@shineklbm
Copy link

I was able to resolve this issue, by running the npm ci (clean install) instead of npm install or tns install. I think it is happening due to some node modules update. Anyway thanks for the support.

@NickIliev
Copy link
Contributor Author

@shineklbm try executing uninstall before updating (or as shown above use clean install)

npm uninstall -g nativescript
npm i -g nativescript

@rosen-vladimirov
Copy link
Contributor

Hey all,
The error indicates you are using one of the next versions of nativescript-dev-webpack. As we are preparing the next major version of NativeScript (6.0.0), the next version of nativescript-dev-webpack is compatible only with it. So you should either use next versions of both CLI and nativescript-dev-webpack or their official versions.

NOTE: Do not forget to update your webpack.config.js when changing nativescript-dev-webpack versions, i.e. after installing the new version, execute ./node_modules/.bin/update-ns-webpack --configs

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

No branches or pull requests

3 participants