NativeScript / nativescript-dev-sass

SASS CSS pre-processor for NativeScript projects
Apache License 2.0
44 stars 17 forks source link

Error is: SASS compiler failed with exit code 1. How to troubleshoot issue with no debugging info? #57

Closed Pyronerd62 closed 6 years ago

Pyronerd62 commented 6 years ago

This has happened 3 times in a row. Each time, I have to create a new project and copy my code into it. I have a Nativescript angular project setup using SASS. All is working fine then all of a sudden. Each time I wasn't even working with the Sass files. Nothing has changed in them. There's no debugging info or anything to troubleshoot the issue. T

Unable to apply changes on device: emulator-5554. Error is: SASS compiler failed with exit code 1.
Executing after-watch hook from /Users/<user>/Developer/<app>/hooks/after-watch/nativescript-dev-sass.js
Executing after-watch hook from /Users/<user>/Developer/<app>/hooks/after-watch/nativescript-dev-typescript.js

The project folder is setup according to https://docs.nativescript.org/ui/theme. Actually, that's the only code in those .scss files currently.

Do you all have any info to troubleshoot this issue?

In the meantime I'll just compile my sass file separately using compass.

radeva commented 6 years ago

Hi @Pyronerd62 ,

Which versions of Nativescript are you using? Could you run tns info and paste the result here. Thanks!

Pyronerd62 commented 6 years ago

$ tns info All NativeScript components versions information ┌──────────────────┬─────────────────┬────────────────┬──────────────────┐ │ Component │ Current version │ Latest version │ Information │ │ nativescript │ 3.3.1 │ 3.4.0 │ Update available │ │ tns-core-modules │ 3.3.0 │ 3.4.0 │ Update available │ │ tns-android │ 3.3.1 │ 3.4.0 │ Update available │ │ tns-ios │ 3.3.0 │ 3.4.0 │ Update available │ └──────────────────┴─────────────────┴────────────────┴──────────────────┘

radeva commented 6 years ago

Hi @Pyronerd62 ,

We are able reproduce such error only when the plugin is added, there is no any scss file available and you try to start the app. See https://github.com/NativeScript/nativescript-dev-sass/issues/56 for reference.

For the case you're expereincing, could you provide a sample NativeScript Playground app where this behavior is reproducible?

On a separate note, under the hood the sass plugin uses node-sass, so you can try to compile your scss files using node-sass directly and check what happens there. The error you receive actually happens when node-sass fails to compile.

Also, could you tell what's the OS you're using? It seems like here is an issue with OSX High Sierra reported . #53

akaco commented 6 years ago

I have same problem I just run this command : npm rebuild node-sass --force after process finish tns run ... problem solved

Pyronerd62 commented 6 years ago

What's weird is that your post gave me an idea. I deleted the android and ios packages directories and deleted the node_modules directory. Ran

tns platform add ios
tns run ios 

or

tns platform add android
tns run android 

and the error is gone. I'm assuming something happened during a previous build. I'm trying to reproduce the issue but it's gone now. I don't know. This is weird. If I encounter this issue again and if this solution I used doesn't work then I'll open another issue. For now, I think something is happening during the live watch that without more detailed log info will almost be impossible to troubleshoot. Thanks you all for your help. Maybe this will help someone else down the road.

radeva commented 6 years ago

Thanks @Pyronerd62 for describing your solution. I will now close this issue and in case you experience any problems, just open a new one.

montella1507 commented 6 years ago

@radeva

1) tns create test2 -ng 2) Everything OK 3) tns install sass 4) `Executing before-watch hook from D:\GIT\nativescript\ns2\test2\hooks\before-watch\nativescript-dev-sass.js Found peer node-sass fs.js:928 return binding.readdir(pathModule.toNamespacedPath(path), options.encoding); ^

Error: ENOENT: no such file or directory, scandir 'D:\GIT\nativescript\ns2\test2\node_modules\node-sass\vendor' at Object.fs.readdirSync (fs.js:928:18) at Object.getInstalledBinaries (D:\GIT\nativescript\ns2\test2\node_modules\node-sass\lib\extensions.js:129:13) at foundBinariesList (D:\GIT\nativescript\ns2\test2\node_modules\node-sass\lib\errors.js:20:15) at foundBinaries (D:\GIT\nativescript\ns2\test2\node_modules\node-sass\lib\errors.js:15:5) at Object.module.exports.missingBinary (D:\GIT\nativescript\ns2\test2\node_modules\node-sass\lib\errors.js:45:5) at module.exports (D:\GIT\nativescript\ns2\test2\node_modules\node-sass\lib\binding.js:15:30) at Object. (D:\GIT\nativescript\ns2\test2\node_modules\node-sass\lib\index.js:14:35) at Module._compile (module.js:649:30) at Object.Module._extensions..js (module.js:660:10) at Module.load (module.js:561:32)`

tns info: √ Getting NativeScript components versions information... √ Component nativescript has 4.1.2 version and is up to date. √ Component tns-core-modules has 4.1.0 version and is up to date. √ Component tns-android has 4.1.3 version and is up to date.

i have ile app.scss (renamed from app.css)

However i had to use built node-sass in the past because of incompatibility of node 10 and node-sass.. so when i rebuild node-sass i got: Installed to D:\Programy\NODE-SASS-TEMPORAL\win32-x64-64_binding.node node-sass@4.9.2 D:\GIT\nativescript\ns2\test2\node_modules\node-sass

(install folder is different than last row?)