-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node modules SCSS imports not resolved properly in nested path #15283
Labels
duplicate
This issue or pull request already exists
Comments
Start a new pull request in StackBlitz Codeflow. |
Duplicate of #12227 |
sapphi-red
added
duplicate
This issue or pull request already exists
and removed
pending triage
labels
Dec 9, 2023
@sapphi-red While I believe this is a minor bug, I don't think it is the same case as the one you marked as duplicate of this. Here there is no issue with node module's style transively importing other style since we are importing CSS file. |
I believe the underlying problem is same and will be fixed by #15000. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Like in stackblitz, we noticed that there is some issue with imports from external packages if "root" SCSS file which imports 3rd party styles is not located in the root directory.
If you move the
main.scss
file into root directory like here:https://stackblitz.com/edit/vue3-vite-starter-r4t51x?file=package.json,src%2FApp.vue,src%2Fmain.js
the error goes away and everything works.
The issue here seem to be that for some reason when "root" SCSS file is inside
app/styles
directory then it tries to resolve the path like for exampleapp/styles/v-calendar
, but when you move themain.scss
into root directory then it will remove thisapp/styles
goes away and then it assumes it is the node module and correctly resolve it from there.Not sure if this is related to Vite and it's CSS/SASS plugin itself or maybe it is related to Vue plugin (importing SASS file from script block or JS file seem to correctly import and process the SCSS file). It's worth noting that not every package has this problem (kinda weird, some of other packages do not report this error even though they also have the correct "exports" field in package.json)
Reproduction
https://stackblitz.com/edit/vue3-vite-starter-wmnist?file=package.json,src%2FApp.vue,src%2Fmain.js,vite.config.js
Steps to reproduce
Go to stackblitz and check the console
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: