Nativescript-cli: TNS run endless deployment loop

Created on 29 Jul 2017  路  14Comments  路  Source: NativeScript/nativescript-cli

Hi Guys,

I am experiencing some issues where TNS run gets stuck in an endless loop deploying changes to the simulator.

This generally happens when TNS run is already watching an app and you make changes. The changes will be copied to the app over and over. You have to kill the terminal to break out of the loop.

I cannot reproduce all the time it but it happens frequently.

I am using TNS 3.1.3 on a Mac. I have seen the issue on IOS and Android simulators.

Regards,
Tarek

livesync needs more info

All 14 comments

This is an example

CONSOLE LOG file:///app/components/side-menu/side.menu.component.js:17:20: null
Executing before-prepare hook from /Users/xxx/Projects/xxx/xxx/xxx-mobile/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Project successfully prepared (iOS)
Successfully transferred app.css.
Successfully transferred login.component.css.
Refreshing application...
Successfully synced application au.xxx.xxx.xxx on device XX697F39-XXXX-XXXX-AE0C-0A1745361B89.
Executing before-prepare hook from /Users/xxx/Projects/xxx/xxx/xxx-mobile/hooks/before-prepare/nativescript-dev-less.js
Jul 31 12:18:33 Tareks-MacBook-Pro CoreSimulatorBridge[94097]: Pasteboard change listener callback port <NSMachPort: 0x7fae63810380> registered
Jul 31 12:18:33 Tareks-MacBook-Pro CoreSimulatorBridge[94097]: Pasteboard change listener callback port <NSMachPort: 0x7fae60f02310> registered
CONSOLE LOG file:///app/tns_modules/@angular/core/./bundles/core.umd.js:3053:20: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
CONSOLE LOG file:///app/components/side-menu/side.menu.component.js:17:20: null
Executing before-prepare hook from /Users/xxx/Projects/xxx/xxx/xxx-mobile/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Project successfully prepared (iOS)
Successfully transferred login.component.css.
Successfully transferred app.css.
Refreshing application...
Successfully synced application au.xxx.xxx.xxx on device XX697F39-XXXX-XXXX-AE0C-0A1745361B89.
Executing before-prepare hook from /Users/xxx/Projects/xxx/xxx/xxx-mobile/hooks/before-prepare/nativescript-dev-less.js
Jul 31 12:18:36 Tareks-MacBook-Pro CoreSimulatorBridge[94097]: Pasteboard change listener callback port <NSMachPort: 0x7fae6390ffa0> registered
Jul 31 12:18:36 Tareks-MacBook-Pro CoreSimulatorBridge[94097]: Pasteboard change listener callback port <NSMachPort: 0x7fae63a02d40> registered
CONSOLE LOG file:///app/tns_modules/@angular/core/./bundles/core.umd.js:3053:20: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
CONSOLE LOG file:///app/components/side-menu/side.menu.component.js:17:20: null
Executing before-prepare hook from /Users/xxx/Projects/xxx/xxx/xxx-mobile/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Project successfully prepared (iOS)
Successfully transferred app.css.
Successfully transferred login.component.css.
Refreshing application...
Successfully synced application au.xxx.xxx.xxx on device XX697F39-XXXX-XXXX-AE0C-0A1745361B89.
Executing before-prepare hook from /Users/xxx/Projects/xxx/xxx/xxx-mobile/hooks/before-prepare/nativescript-dev-less.js
Jul 31 12:18:38 Tareks-MacBook-Pro CoreSimulatorBridge[94097]: Pasteboard change listener callback port <NSMachPort: 0x7fae60c169a0> registered
Jul 31 12:18:38 Tareks-MacBook-Pro CoreSimulatorBridge[94097]: Pasteboard change listener callback port <NSMachPort: 0x7fae63a0b100> registered
CONSOLE LOG file:///app/tns_modules/@angular/core/./bundles/core.umd.js:3053:20: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
CONSOLE LOG file:///app/components/side-menu/side.menu.component.js:17:20: null
Executing before-prepare hook from /Users/xxx/Projects/xxx/xxx/xxx-mobile/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Project successfully prepared (iOS)
Successfully transferred app.css.
Successfully transferred login.component.css.
Refreshing application...
Successfully synced application au.xxx.xxx.xxx on device XX697F39-XXXX-XXXX-AE0C-0A1745361B89.
Executing before-prepare hook from /Users/xxx/Projects/xxx/xxx/xxx-mobile/hooks/before-prepare/nativescript-dev-less.js
Jul 31 12:18:41 Tareks-MacBook-Pro CoreSimulatorBridge[94097]: Pasteboard change listener callback port <NSMachPort: 0x7fae6390c8f0> registered
Jul 31 12:18:41 Tareks-MacBook-Pro CoreSimulatorBridge[94097]: Pasteboard change listener callback port <NSMachPort: 0x7fae60c16a50> registered
CONSOLE LOG file:///app/tns_modules/@angular/core/./bundles/core.umd.js:3053:20: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
CONSOLE LOG file:///app/components/side-menu/side.menu.component.js:17:20: null
Executing before-prepare hook from /Users/xxx/Projects/xxx/xxx/xxx-mobile/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Project successfully prepared (iOS)
Successfully transferred app.css.
Successfully transferred login.component.css.
Refreshing application...
Successfully synced application au.xxx.xxx.xxx on device XX697F39-XXXX-XXXX-AE0C-0A1745361B89.
Skipping prepare.
Jul 31 12:18:43 Tareks-MacBook-Pro CoreSimulatorBridge[94097]: Pasteboard change listener callback port <NSMachPort: 0x7fae60c1af80> registered
Jul 31 12:18:44 Tareks-MacBook-Pro CoreSimulatorBridge[94097]: Pasteboard change listener callback port <NSMachPort: 0x7fae60c1b030> registered
CONSOLE LOG file:///app/tns_modules/@angular/core/./bundles/core.umd.js:3053:20: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
CONSOLE LOG file:///app/components/side-menu/side.menu.component.js:17:20: null
Successfully transferred app.css.
Successfully transferred login.component.css.
Refreshing application...
Successfully synced application on device XX697F39-XXXX-XXXX-AE0C-0A1745361B89.
CONSOLE LOG file:///app/tns_modules/@angular/core/./bundles/core.umd.js:3053:20: Angular is running in the development mode. Call enableProdMode() to enable the production mode.

Hi @thaoula

Can you please specify node and npm version on your machines and post package.json of your project?
I suppose the issue is cased by some 3rd party nativescript plugin.
Do you experience the same issue with hello-world project?

Hi @dtopuzov,

I am using npm 5.3.0 and node 8.

For plugins, I am using -

  • Telerik UI for Nativescript Pro
  • nativescript-dev-less (for processing less files)

Regards,
Tarek

Actually experiencing the same issue. was able to narrow it down to nativescript-dev-sass and it only affects my iOS builds.

Can you try with npm4 (easy way to downgrade is npm i -g npm@4)?
I suppose nativescript-dev-sass is not compatible with npm5.
If that is the case I think it will be better to move the issue to nativescript-dev-sass repo.

@dtopuzov

npm --v 4.6.1

@thaoula @dtopuzov, It turns out the issue i had involved node-sass leaving behind running processes in the background even after killing the main tns debug process. This means i'd have to kill them off manually and this happens only on my mac.

Hi,

I don't use sass but I use less. Could something similar be happening?

Regards,
Tarek

Hey @thaoula ,
The problem is in the nativescript-dev-less plugin and I've created a PR to fix it.

@jogboms , I've tried to reproduce the issue with nativescript-dev-sass plugin, but without success. Can you give more information when do you experience orphan node-sass processes?

@jogboms , I've found a use-case via NativeScript Sidekick that may cause a behaviour similar to the one that you've described. I've created a PR in nativescript-dev-sass plugin in order to resolve the issue.
The problem there is that node-sass process is kept alive even when LiveSync operation is stopped in NativeScript Sidekick.

In case you have any other clues what might have left the node-sass process running after CLI is killed, we may try to reproduce the case on our side.

@jogboms @thaoula
[email protected] is released and it should solve the issue.

@rosen-vladimirov I'm so sorry for the long absence. Thanks for all your help.
This issue in fact only arises on my machine when i use tns debug. What happens is that at times, the debug service crashes leaving behind the node-sass process.

@thaoula the issue with nativescript-dev-less plugin should be resolved as well, we've published version 0.0.11 :)

@jogboms thanks, we'll try to reproduce it on our side.

Was this page helpful?
0 / 5 - 0 ratings