SCSS file compiles in Visual Studio 2019 but not in 2022

2.2k views Asked by At

I have a number of import statements at the top of the SCSS file in a project I've inherited. Here are the relevant statements:

...
@import "node_modules/bulma/bulma.sass";
...
@import "node_modules/buefy/src/scss/buefy.scss";
...

Using Webcompiler, the SCSS file compiles in Visual Studio 2019. However, when I try to compile it in Visual Studio 2022 I get an error saying it can't find the bulma stylesheet. I tried adding "node_modules" to the includePath in the SASS section of compilerconfig.json.defaults. This seemed to work for the bulma stylesheet but I then got that same error on the buefy stylesheet. The files are definitely present (otherwise it wouldn't compile in VS2019).

Anyone any ideas? Is there a setting in Visual Studio 2022 that I'm missing?

Thanks

3

There are 3 answers

0
JimiSweden On BEST ANSWER

the extension webcompiler does not work with visual studio 2022 (not sure if it will be fixed)

2
João Mendes On

Someone ported the extensions to VS2022

Note: I'm not the author of the port, or of the original extensions.

0
Pasilda On

I had a similar error when attempting to compile a .scss file. I got it working by removing (or renaming) the temp folder for the WebCompiler extension:

  1. Close VS2022
  2. Go to C:\Users\<your user name>\AppData\Local\Temp\
  3. Remove or rename the "WebCompiler<current version>" folder
  4. Open VS2022 - it should rebuild the "WebCompiler<current version>" folder
  5. Right-click the .scss file in the solution, then Web Compiler > Compile file (or Re-compile file)