vscode-scss icon indicating copy to clipboard operation
vscode-scss copied to clipboard

Unable to find node_modules

Open nfMalde opened this issue 2 years ago • 1 comments

  • VS Code Version: 1.74.4
  • SCSS IntelliSense Version: 1.058.833
  • Operating System: Windows 11 Pro Having an angular project with folder Structure like this:
.
node_modules
src/scss/vendor/_fa.scss
src/scss/main.scss

See: https://github.com/nfMalde/scss-minimal-sample where _fs.scss imports stylesheets from an package


@import "@fortawesome/fontawesome-free/scss/fontawesome.scss";
@import "@fortawesome/fontawesome-free/scss/solid.scss";
@import "@fortawesome/fontawesome-free/scss/regular.scss";
@import "@fortawesome/fontawesome-free/scss/brands";

Visual Studio Code cant resolve the path correctly to provide intellisense for variables and functions.

Reproducible Case:

Steps to Reproduce:

  1. Open the sample project
  2. Open File _fa.scss
  3. CTRL + Click on a path for example "@fortawesome/fontawesome-free/scss/fontawesome.scss"
  4. It will try to open it starting from directory of "_fa.scss" eg . "src/scss/vendor/@fortawesome/fontawesome-free/scss/fontawesome.scss" instead of "node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss"
  5. Tide (~) is not an option anymore since angular 13+ does not allow that anymore / doesnt support it and throws errors.
  6. Using the full path works however: "@import "../../../node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss"

nfMalde avatar Feb 24 '23 13:02 nfMalde

Go to the settings of the extension and make sure node_modules is not on this list:

CleanShot 2023-04-03 at 14 15 00

hossammourad avatar Apr 03 '23 18:04 hossammourad