question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug(scss): import paths have changed

See original GitHub issue

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

v12

Description

In v12, I used the following import in SCSS files @use "~@angular/material" as mat;.

After migrating to Angular v13, only the following import works @use "@angular/material" as mat;. However, Webstorm does not recognize the import.

Reproduction

Steps to reproduce:

  1. Migrate to Angular (Material) v13
  2. Use @use "~@angular/material" as mat;

Expected Behavior

Old imports work as expected.

Actual Behavior

I had to change the import to @use "@angular/material" as mat;, which causes IDE warnings.

Environment

  • Angular:
  • CDK/Material: 13.0.0
  • Browser(s): any
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 11, macOS Monterey

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ecruz165commented, Nov 28, 2021

The WebStorm issues will be resolved soon, see https://youtrack.jetbrains.com/issue/WEB-53312?_ga=2.16688127.810438460.1636730288-874848357.1590392228

Webstorm started recognizing paths after adding the following to angular.json under build

            "stylePreprocessorOptions": {
              "includePaths": [
                "src/styles",
                "node_modules"
              ]
            },
0reactions
angular-automatic-lock-bot[bot]commented, Sep 17, 2022

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SCSS import paths cannot be resolved
i have a very annoying issue with the import paths in my scss. We are using grunt-sass for compiling several scss files, setting...
Read more >
When using SASS how can I import a file from a different ...
My answer is specific to including directories other than subdirectories, but works for those, too. But: It's not the idiomatic way to do...
Read more >
Sass: @use
The @use rule loads mixins, functions, and variables from other Sass ... This is different from the old @import rule, which encouraged that...
Read more >
Stop using @import with Sass | @use and @forward explained
Keep up to date with my Sass course: https://beyondcss.dev/?utm_campaign=OlderYouTubeVideos&utm_source=YouTubeThe use of @ import has been ...
Read more >
sass-loader - webpack - JS.ORG
Prepending module paths with a ~ tells webpack to search through node_modules . @import ... Writing @import "style.scss" is the same as @import...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found