Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Always receiving "Extension host terminated unexpectedly" #112

Open
dineiar opened this issue Nov 12, 2018 · 53 comments
Open

Always receiving "Extension host terminated unexpectedly" #112

dineiar opened this issue Nov 12, 2018 · 53 comments

Comments

@dineiar
Copy link

dineiar commented Nov 12, 2018

When I open a workspace in VS Code, even without having any scss file open, I'm receiving the message "Extension host terminated unexpectedly". Details:
screenshot from 2018-11-12 12-20-25
When the extension is disabled everything works fine.

I have the Live Server extension installed. This is different from #53 , as I'm receiving the error just by opening VS Code.

Reproduced in 2 versions:
VS Code v1.28.0 - commit 431ef9da3cf88a7e164f9d33bf62695e07c6c2a9
VS Code v1.28.2 - commit 7f3ce96ff4729c91352ae6def877e59c561f4850
Environment:
Electron: 2.0.9
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

@Abourass
Copy link

Abourass commented Jan 1, 2019

Same and its all Sass extensions, not just this one. I tried installing node-sass globally, hoping perhaps it was that. It was not.

@Tigerlady
Copy link

I too am having this issue.

@SimonMayerhofer
Copy link

Same. Seems like it can't handle comments like this:

//@import "plugins/xxx";

at least that's was the problem at my side.

@ghost
Copy link

ghost commented Feb 6, 2019

also having issues, but only after vs code updated.

@samirdjelal
Copy link

Same here, after latest vscode update it seems stopping with the same error

@davidcsida
Copy link

davidcsida commented Feb 11, 2019

I'm also experiencing the same problem when using @import.

@davidcsida
Copy link

I'm also experiencing the same problem when using @import.

I found out that crashes only happen while writing @import. If I finish writing the path and restart the extensions, everything works perfectly.

@samirdjelal
Copy link

I don't use @import at all but i still get that crash, even that i made my scss empty again to findout if the file is content crashing the ext, but it even crash on empty file. while I changed the priject to find out that it works on some projects

@yehudaTiram
Copy link

In my case the problem was solved by removing "Image Preview" Extension. For some reason it caused live-sass-compiler to generate "Extension host terminated unexpectedly."

@norixx
Copy link

norixx commented Feb 19, 2019

@yehudaTiram It worked for me too. Some code confliction?? I cannot tell which extension causes this error, I've removed 'Image Preview' for the time being.

@yehudaTiram
Copy link

I guess both can't work together.

@FelesNoctis
Copy link

FelesNoctis commented Feb 21, 2019

This should be resolved with Image Preview 0.17.4. My environment's working correctly again with both enabled.

kisstkondoros/gutter-preview#40

@mattgriffiths4
Copy link

Is anyone else still having this issue? Every time I start writing @import in my main.scss file it crashes the sass-compiler extension? I don't have the image preview extension installed either... really annoying!

@eteisman
Copy link

eteisman commented May 2, 2019

I now have the same issue. One very similar project is OK, the other crashes.
But I absolutely cant make sense of why this is happening at all.

Update: I am no longer able to build my project. It is broken, and no idea why!!!

Update 2: After re-creating my workspace from GIT, the sass-compiler works again.
I am unable to figure out why the sass-compiler crashes in one directory, yet compiles in the other.

@mizhon
Copy link

mizhon commented May 18, 2019

Image Preview

I don't install the "Image preview" extension but still get the same crash error. So I think that's not the common method to fix this issue.

@SmithWebDev
Copy link

My issue was with the Live Sass Compiler... once uninstalled, no longer had the same extension host error

@FelesNoctis
Copy link

FelesNoctis commented Jun 9, 2019

Is anyone else still having this issue? Every time I start writing @import in my main.scss file it crashes the sass-compiler extension? I don't have the image preview extension installed either... really annoying!

I can confirm that I've been having this issue again, and only with files with @import. Specifically, in the project I'm working on, these imports work perfectly fine due to the environment configuration (as in, the program in question utilizes them just fine), but that environment is also non-standard. Effectively, the program itself is reading the core SCSS files from one folder and using those import paths as a reference, and then has a different folder outside of that path that actually has the files. VSCode is confused as all hell, but the program knows what its doing.

That being said, obviously it's difficult for Live SASS Compiler, or anybody else for that matter, to adapt to strange environments like that. However I AM surprised that an error catch hasn't been designed yet. LSC shouldn't be so brittle that another extension can kill it.

Also see:
enyancc/vscode-ext-color-highlight#53

@FelesNoctis
Copy link

FelesNoctis commented Jun 9, 2019

As an example:

css/bootstrap/_bootstrap.scss
css/bootstrap/_bootstrap.scss targeting files within css/bootstrap/bootstrap/
This works entirely as expected within VSCode, no extension issues.

css/bootstrap.scss
css/bootstrap.scss targeting files within css/bootstrap/bootstrap/
Explosions, lasers, death, destruction, and the extension host failing.

As above, the second example above works fine within the program itself for various reasons, but VSCode isn't aware of that environment so it has a seizure. And no, I have no idea why the project is set up this way.


This isn't the first time I've run into an issue with another extension making Live SASS Compiler eat itself and take the extension host with it, which, as above, is why I'm surprised there isn't an error catch for this sort of thing implemented. It shouldn't burn the house down for a roach.

@ErSulba
Copy link

ErSulba commented Jul 13, 2019

i'm having the same error while the highlight-colors and live-sass-compiler extensions are running, it's kinda annoying since you have deactivate the highlight colors extension if you want to continue using the sass compiler

@PiotrGrzy
Copy link

Same thing here, happes only when using @import...Anyone solved this problem?

@airosu
Copy link

airosu commented Jul 19, 2019

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

@russmatt
Copy link

Apparently solved disablingthe extension and re-enabling it after opening the project.

@ZippoLee12138
Copy link

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

Thank you!

@zhaluza
Copy link

zhaluza commented Sep 21, 2019

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

This seems to fix it for me — thanks!

@SuiYoung
Copy link

SuiYoung commented Jan 28, 2020

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

Thank you for this!
There's an extension conflict with "color highlight" extension. This addition to settings.json fixed the issue. No more crashes.

@alimertcakar
Copy link

alimertcakar commented Feb 25, 2020

adding an empty /* */ end of a scss file crashes the extension also.

@sumandeveloping
Copy link

sumandeveloping commented Apr 6, 2020

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

It worked for me superbly.....

@power-f-GOD
Copy link

power-f-GOD commented Apr 14, 2020

For me, the issue was caused by Live Sass Compiler. If it's same with you, do these:

  1. Reload extension host;
  2. Uninstall LSC;
  3. Reload VS Code;

That should fix the error. If you need something like LSC, do the following:

  1. Install node-sass globally with npm i -g node-sass;
  2. Then run (in watch mode) with node-sass -w --output-style=compressed path/to/file.scss path/to/file.min.css; and it's way faster than LSC in compilation.
    Note that the watch and output-style flags are optional.

PS: You can add a "sass" prop/key in the "scripts" section of "package.json" and assign it a value of the script to run: node-sass -w --output-style=compressed path/to/file.scss path/to/file.min.css; with that you can then run npm run sass from your project directory to compile your SCSS file(s).

https://www.npmjs.com/package/node-sass#command-line-interface

@shubhdevelop
Copy link

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

Thanks man this seriously made my day, I was googling some solution for hours worked for me!

@jibaraakira
Copy link

For my "Extension host terminated unexpectedly" , console error says TypeError : cannot read property 'length' of undefined .

This error occurred even after setting “ color-highlight.languages ”: [“ * ”,“! Scss ”] to setting.json.

consoleOfSass sync js

@jibaraakira
Copy link

jibaraakira commented May 31, 2020

I have resolved this error. As a method, I realized a little by rewriting the js file of "Live Sass Compiler". The process of work until resolution is as follows.

  1. First, find the following folder. (This is the Windows path.).This is the cause of the error.C:\Users\<user>\.vscode\extensions\ritwickdey.live-sass-3.0.0\node_modules\sasslib\sass.sync.js
  2. Format sass.sync.js with "js-beautify". The reason is that the part to throw error is in the one liner, and it is specified by indenting it. (we recommend making a copy of sass.sync.js.)
  3. Start Vscode with formatted code, generate the error mentioned earlier, and see the console screen of the developer tool. Actually, the image of the error in the comment just before this comment is the console screen.
  4. Then, according to the number of lines in the error message, I found the following part of sass.sync.js and commented out like this.
        process["on"]("uncaughtException", (function(ex) {
         //if (!(ex instanceof ExitStatus)) {
         //   throw ex
         //   }
        }));
  1. This is the end. Now you can use Live Sass Compiler.

@thinksea927
Copy link

thinksea927 commented Jun 3, 2020

I have resolved this error. As a method, I realized a little by rewriting the js file of "Live Sass Compiler". The process of work until resolution is as follows.

  1. First, find the following folder. (This is the Windows path.).This is the cause of the error.C:\Users\<user>\.vscode\extensions\ritwickdey.live-sass-3.0.0\node_modules\sasslib\sass.sync.js
  2. Format sass.sync.js with "js-beautify". The reason is that the part to throw error is in the one liner, and it is specified by indenting it. (we recommend making a copy of sass.sync.js.)
  3. Start Vscode with formatted code, generate the error mentioned earlier, and see the console screen of the developer tool. Actually, the image of the error in the comment just before this comment is the console screen.
  4. Then, according to the number of lines in the error message, I found the following part of sass.sync.js and commented out like this.
        process["on"]("uncaughtException", (function(ex) {
         //if (!(ex instanceof ExitStatus)) {
         //   throw ex
         //   }
        }));
  1. This is the end. Now you can use Live Sass Compiler.

Thanks Jibaraakira, I follow your way and seems it works!
btw, i didn't use js-beautify since i got some issue from making js beautify, so i deleted the commented part instead.

@ricardo-martinez-dev
Copy link

In case anyone is still having problems with the extension, I've noticed that if I use @import with the wrong address it'll cause the extension to terminate. It's worthy checking it and give it another try.

@alapo92
Copy link

alapo92 commented Jun 8, 2020

I have resolved this error. As a method, I realized a little by rewriting the js file of "Live Sass Compiler". The process of work until resolution is as follows.

  1. First, find the following folder. (This is the Windows path.).This is the cause of the error.C:\Users\<user>\.vscode\extensions\ritwickdey.live-sass-3.0.0\node_modules\sasslib\sass.sync.js
  2. Format sass.sync.js with "js-beautify". The reason is that the part to throw error is in the one liner, and it is specified by indenting it. (we recommend making a copy of sass.sync.js.)
  3. Start Vscode with formatted code, generate the error mentioned earlier, and see the console screen of the developer tool. Actually, the image of the error in the comment just before this comment is the console screen.
  4. Then, according to the number of lines in the error message, I found the following part of sass.sync.js and commented out like this.
        process["on"]("uncaughtException", (function(ex) {
         //if (!(ex instanceof ExitStatus)) {
         //   throw ex
         //   }
        }));
  1. This is the end. Now you can use Live Sass Compiler.

I have found this to help with the issue as well ! Thanks Jibaraakira!

@kitravee
Copy link

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

Thank you airosu!

@Ollie-lee
Copy link

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

Thank you so much! It works!

@norixx
Copy link

norixx commented Aug 19, 2020

I have resolved this error. As a method, I realized a little by rewriting the js file of "Live Sass Compiler". The process of work until resolution is as follows.

  1. First, find the following folder. (This is the Windows path.).This is the cause of the error.C:\Users\<user>\.vscode\extensions\ritwickdey.live-sass-3.0.0\node_modules\sasslib\sass.sync.js
  2. Format sass.sync.js with "js-beautify". The reason is that the part to throw error is in the one liner, and it is specified by indenting it. (we recommend making a copy of sass.sync.js.)
  3. Start Vscode with formatted code, generate the error mentioned earlier, and see the console screen of the developer tool. Actually, the image of the error in the comment just before this comment is the console screen.
  4. Then, according to the number of lines in the error message, I found the following part of sass.sync.js and commented out like this.
        process["on"]("uncaughtException", (function(ex) {
         //if (!(ex instanceof ExitStatus)) {
         //   throw ex
         //   }
        }));
  1. This is the end. Now you can use Live Sass Compiler.

So this is the solid resolution so far. Thanx @jibaraakira

@NwosaEmeka
Copy link

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

Finally a solution that worked for me, thanks a lot

@adhamaa
Copy link

adhamaa commented Oct 1, 2020

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

YEAY very helpful, thanks man...

@Christopher-Hayes
Copy link

Christopher-Hayes commented Dec 20, 2020

Hey guys, @glenn2223 is continuing work on this extension in a new repo at: https://github.com/glenn2223/vscode-live-sass-compiler
This bug has been causing trouble for me too, but with Glenn's updated extension this bug has been fixed. I haven't had the extension host crash yet!
If you search for "Live SASS Compiler - Glenn Marks", you can test out the preview extension. Note that this extension uses Dart SASS which will have the latest SASS specs, but may run slightly different than the deprecated Node SASS.

@new103
Copy link

new103 commented Jan 4, 2021

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

Thank you! It works perfect!

@Y1a2s3h4
Copy link

Same. Seems like it can't handle comments like this:

//@import "plugins/xxx";

at least that's was the problem at my side.

In my case when i use import "something" its terminated

@fatherofphysics
Copy link

Nothing is working in 2021 glen is died.....

@glenn2223
Copy link

I am still actively maintaining my version of this project, please ignore @fatherofphysics comment

@fatherofphysics
Copy link

Improve SASS compiler please very fast it has bugs it cant compile scss. Fix this please kindly @fatherofphysics

@glenn2223
Copy link

Improve SASS compiler please very fast it has bugs it cant compile scss. Fix this please kindly @fatherofphysics

Try my version of this extension. Available at https://marketplace.visualstudio.com/items?itemName=glenn2223.live-sass

If you still have problems then open an issue here -> https://github.com/glenn2223/vscode-live-sass-compiler/issues

@norixx
Copy link

norixx commented Apr 26, 2021

Try my version of this extension. Available at https://marketplace.visualstudio.com/items?itemName=glenn2223.live-sass

@glenn2223 I will give it a shot to your version :)

@stwgabriel
Copy link

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

thanks bro this solved my problem, I believe that the two extensions conflict and causes this error

@Mi-Ski
Copy link

Mi-Ski commented Jul 17, 2021

I am also having this issue running both live sass compiler and color highlight extensions. I was able to fix this by setting the supported languages for color-highlight to everything except for scss in settings.json

"color-highlight.languages": [ "*", "!scss" ]

If you use something like 7-1 folder architecture and import files only in /main.scss this setting works even better - color highlight extension can still work in other files without causing this problem.
"color-highlight.languages": [ "!main.scss" ],

@GAYOUNG914
Copy link

또한 라이브 sass 컴파일러와 색상 강조 표시 확장을 모두 실행하는 이 문제가 있습니다. settings.json에서 scss를 제외한 모든 색상 강조 표시에 지원되는 언어를 설정하여 이 문제를 해결할 수 있었습니다.
"color-highlight.languages": [ "*", "!scss" ]

7-1/main.scs만 주문하고 더 많은 주문을 받고 있습니다. 뛰어난 성능 향상을 위해 이 작업을 계속할 수 있습니다.
"color-highlight.languages": [ "!main.scss" ],

thank you sir you made my day

@rivasspro
Copy link

Solucionado!

instale Live Sass Compiler by Glen Marks v5.1.0
image
Captura de Pantalla 2021-08-25 a la(s) 10 20 30

@VenomousFox
Copy link

If you want to use the sass live compiler and color highlight extension without excluding scss
try installing Glenn Marks Live Sass Compiler Version it will solve the problem.

image

@fatherofphysics
Copy link

Please close this issue

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

No branches or pull requests