Skip to content

When file watch is active saving shuts down emulator #195

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

Open
akakira opened this issue Jul 31, 2018 · 11 comments
Open

When file watch is active saving shuts down emulator #195

akakira opened this issue Jul 31, 2018 · 11 comments

Comments

@akakira
Copy link

akakira commented Jul 31, 2018

Recently when in watch mode my emulator shuts down completely every time i make a change in watch mode. On the device the app no longer launches on change. Also previously when I clicked stop, the emulator would stay open. It no longer does which is inconvenient.

when starting the extension outputs
[NativeScriptCli] execute: tns --analyticsClient VSCode --version
Version: 0.8.0
Build version: v.2018.7.27.1
Commit id: 4bdd611
NativeScript CLI: 4.1.2

Then debug
3:15:00 PM - Compilation complete. Watching for file changes.
Skipping prepare.
Successfully transferred login.component.js.

after that the emulator stops, the device does not re-launch the application.
I am on macOS High Sierra 10.13.6

this behavior happens with ios and android.

Attempts to fix:
updated the global tns
ran tns doctor, no issues

here is my package.json
"nativescript": {
"id": "com.virtuescript.www",
"tns-android": {
"version": "4.1.3"
},
"tns-ios": {
"version": "4.1.0"
}
},
"dependencies": {
"@angular/animations": "~6.0.0",
"@angular/common": "~6.0.0",
"@angular/compiler": "~6.0.0",
"@angular/core": "~6.0.0",
"@angular/forms": "~6.0.0",
"@angular/http": "~6.0.0",
"@angular/platform-browser": "~6.0.0",
"@angular/platform-browser-dynamic": "~6.0.0",
"@angular/router": "~6.0.0",
"nativescript-angular": "~6.0.0",
"nativescript-calendar": "^2.0.0",
"nativescript-theme-core": "~1.0.4",
"nativescript-unit-test-runner": "^0.3.4",
"reflect-metadata": "~0.1.8",
"rxjs": "~6.0.0 || >=6.1.0",
"tns-core-modules": "^4.1.1",
"zone.js": "^0.8.26"
},
"devDependencies": {
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"jasmine-core": "^3.1.0",
"karma": "^2.0.4",
"karma-jasmine": "^1.1.2",
"karma-nativescript-launcher": "^0.4.0",
"lazy": "1.0.11",
"nativescript-dev-typescript": "~0.7.0",
"tns-platform-declarations": "^4.1.0",
"typescript": "~2.7.2"
}

@ivanovit
Copy link
Contributor

ivanovit commented Aug 2, 2018

Hi,

Is this issue reproducible when using CLI with LiveSync (without VSCode) or only when the VSCode debugger is attached?

@turai
Copy link

turai commented Aug 2, 2018

tns debug by itself works great, using it right now.
I've tried this extension with the stable and insiders version, same issue. Built older commits, only difference was the app starts up, gets killed and restarts, then the debugger shuts down. On the latest commit the app doesn't restart, just gets killed after the first startup. No error reported or anything, it just exits.

@akakira
Copy link
Author

akakira commented Aug 2, 2018

Thanks for testing Turai, this is a reproduction of the issue. Also when using nativescript sidekick it works as expected.

@ivanovit
Copy link
Contributor

ivanovit commented Aug 3, 2018

Hi,

@turai @akakira Thank you for testing and providing the information. We were able to identify the problem and we are working on it. We will update you once we have more information.

@edusperoni
Copy link

Is there any workaround for this for the time being?

@turai
Copy link

turai commented Aug 9, 2018

Well, I used Chrome's inpector for the time being, that's a workaround-ish solution for me. Not too convenient.

@theremon
Copy link

Hello
I'm facing this issue as well on Win10, Nativescript v4.2.0, Node v8.11.3, VSCode v1.25.1 (extension v0.8.0, removed and reinstalled today Aug 10th), Android Emulator (tested using various AVDs with varying API levels).

  • If I start the application from the command line or Sidekick and then Attach VSCode, it works fine (and currently this is my workaround).
  • If I just hit F5 in VSCode, the emulator starts, breakpoints etc work fine but as soon as I make a change and save the file, it starts to refresh the application on the emulator and then crashes the emulator altogether.

Any update on this will be greatly appreciated...

@ivanovit
Copy link
Contributor

Hi,

As a temporary workaround, you can start the emulator separately. In this case, the nativescript CLI will use the running instance. Unfortunately, you may need to reattach the debugger after livesync.

The fix in on pull request and will be released soon so stay tuned.

Sorry for any inconvenience caused.

@KirilOkun
Copy link

@ivanovit Thanks for fixing this issue. It really slows down debugging. Any idea when the fix will be released?

@KirilOkun
Copy link

bump. any updates on this?

@ivanovit
Copy link
Contributor

ivanovit commented Sep 7, 2018

Hi,

In the latest version (released today), the LiveSync process will no longer stop the emulator and you will be able to continue the debugging session after the changes are synced.

Note that emulators launched through VS Code will be stopped when the currently active debugging session is terminated (when we close the debugging session we dispose all resources started in this session). We would welcome any feedback you might have about this change. If you find it annoying, we might consider skipping the emulators when stopping the session despite the fact that they have been started from it.

Currently, to avoid this behavior, you need to launch the emulators manually and not through VS Code.

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

6 participants