Skip to content

SASS nativeScript livesync result in an infinite deploy loop #3377

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 Feb 20, 2018 · 6 comments
Closed

SASS nativeScript livesync result in an infinite deploy loop #3377

NickIliev opened this issue Feb 20, 2018 · 6 comments
Assignees
Labels
Milestone

Comments

@NickIliev
Copy link
Contributor

From @RadouaneRoufid on February 20, 2018 10:2

Tell us about the problem

While running NativeScript app, modifiying a scss file result in an infinite deploy loop.

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.4.0
  • Cross-platform modules: 3.4.0
  • Android Runtime: 3.4.1

Please tell us how to recreate the issue in as much detail as possible.

1- Create a basic NativeScript app
2- Create a sass file: _app-common.scss
3- Create another sass file that imports the _app-common.scss: app.android.scss
@import 'app-common';
4- Start NS : tns run android
5- Make a change in _app-common.scss

This results to an infinite loop:

Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/env-prepare.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-android-snapshot.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-sass.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Executing before-prepareJSApp hook from /home/project/nativescript/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Project successfully prepared (Android)
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-android-snapshot.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-sass.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-webpack.js
Successfully transferred _app-common.scss.
Refreshing application...
JS: NSModuleFactoryLoader is deprecated! You no longer need to provide it as a module loader.
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: ANGULAR BOOTSTRAP DONE. 51477


Successfully synced application com.domain.project on device emulator-5554.
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/env-prepare.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-android-snapshot.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-sass.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Executing before-prepareJSApp hook from /home/project/nativescript/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Project successfully prepared (Android)
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-android-snapshot.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-sass.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-webpack.js
ActivityManager: Start proc 8391:com.domain.project/u0a67 for activity com.domain.project/com.tns.NativeScriptActivity
Successfully transferred all files.
Refreshing application...
JS: NSModuleFactoryLoader is deprecated! You no longer need to provide it as a module loader.
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: ANGULAR BOOTSTRAP DONE. 2510
Successfully synced application com.domain.project on device emulator-5554.
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/env-prepare.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-android-snapshot.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-sass.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Executing before-prepareJSApp hook from /home/project/nativescript/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Project successfully prepared (Android)
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-android-snapshot.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-sass.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-webpack.js


JS: NSModuleFactoryLoader is deprecated! You no longer need to provide it as a module loader.
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: ANGULAR BOOTSTRAP DONE. 3632


Successfully transferred app.css.
Successfully transferred app.css.
Successfully transferred app.css.
Successfully transferred app.css.
Refreshing application...
JS: NSModuleFactoryLoader is deprecated! You no longer need to provide it as a module loader.
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: ANGULAR BOOTSTRAP DONE. 5904
Successfully synced application com.domain.project on device emulator-5554.
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/env-prepare.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-android-snapshot.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-sass.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Executing before-prepareJSApp hook from /home/project/nativescript/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Project successfully prepared (Android)
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-android-snapshot.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-sass.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-webpack.js


Successfully transferred app.css.
Successfully transferred app.css.
Successfully transferred app.css.
Successfully transferred app.css.
Successfully transferred app.css.
Successfully transferred app.css.
Refreshing application...
JS: NSModuleFactoryLoader is deprecated! You no longer need to provide it as a module loader.
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: ANGULAR BOOTSTRAP DONE. 8040
Successfully synced application com.domain.project on device emulator-5554.
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/env-prepare.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-android-snapshot.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-sass.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Executing before-prepareJSApp hook from /home/project/nativescript/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Project successfully prepared (Android)
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-android-snapshot.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-sass.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-webpack.js


Successfully transferred app.css.
Successfully transferred app.css.
Refreshing application...
JS: NSModuleFactoryLoader is deprecated! You no longer need to provide it as a module loader.
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: ANGULAR BOOTSTRAP DONE. 10054
Successfully synced application com.domain.project on device emulator-5554.
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/env-prepare.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-android-snapshot.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-sass.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Executing before-prepareJSApp hook from /home/project/nativescript/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Project successfully prepared (Android)
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-android-snapshot.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-sass.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-webpack.js


Successfully transferred app.css.
Successfully transferred app.css.
Successfully transferred app.css.
Successfully transferred app.css.
Refreshing application...
JS: NSModuleFactoryLoader is deprecated! You no longer need to provide it as a module loader.
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: ANGULAR BOOTSTRAP DONE. 12166
Successfully synced application com.domain.project on device emulator-5554.
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/env-prepare.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-android-snapshot.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-sass.js
Executing before-prepare hook from /home/project/nativescript/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Executing before-prepareJSApp hook from /home/project/nativescript/hooks/before-prepareJSApp/nativescript-dev-webpack.js
^CProject successfully prepared (Android)
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-android-snapshot.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-sass.js
Executing after-prepare hook from /home/project/nativescript/hooks/after-prepare/nativescript-dev-webpack.js


^CSuccessfully transferred app.css.
Successfully transferred app.css.
Successfully transferred app.css.
Successfully transferred app.css.
Successfully transferred app.css.
Successfully transferred app.css.
Refreshing application...

Thank you

Copied from original issue: NativeScript/NativeScript#5442

@jogboms
Copy link

jogboms commented Feb 20, 2018

@RadouaneRoufid can you confirm if you don't have multiple instances of node-sass running? I had a similar issue then whenever the lifesync crashes. It leaves behind a zombie process.

@RadouaneRoufid
Copy link

$ ps -aux | grep sass
user    4221  4.9  0.3 1221732 50436 pts/0   Sl+  11:06  11:16 node-sass
user   11047  0.0  0.0  14568   976 pts/5    R+   14:52   0:00 grep --color=auto sass

The problem occurs with only one instance of node-sass running.

@hosikiti
Copy link

hosikiti commented Feb 21, 2018

@NickIliev I'm not sure if it's related but I had a similar infinite loop issue with node-sass. So I sent a pull request of node-sass-chokidar version of this SASS plugin which works correctly.

NativeScript/nativescript-dev-sass#53

@RadouaneRoufid
Copy link

I was using "nativescript-dev-sass": "^1.1.1" . I upgraded to 1.3.5 but it didn't solve the problem.

@noordw
Copy link

noordw commented Feb 27, 2018

I am also having the same problem with Android or IOS

@Fatme
Copy link
Contributor

Fatme commented Apr 12, 2018

Hi @RadouaneRoufid, @noordw, @hosikiti, @jogboms

This should be fixed in latest version of {N} and nativescript-dev-sass plugin. Can you please update them and try it on your side?

npm i -g nativescript@latest

Go to your project folder and execute:

npm i --save-dev nativescript-dev-sass@latest
rm -rf node_modules
npm i

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

7 participants