-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
relative paths in SCSS cause ModuleNotFoundError #5633
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
Comments
I am trying to fix this but I do not know where to look. Does this seem like a bug in vue-loader? It seems like a problem in the way single file components import their SCSS and pass it on to webpack. |
Prepending the path with a Related: |
Sorry for the late reply. Your two projects are not equivalent, since you use If you do like below, they are equivalent. Then the build of vanilla-appmain.js import './index.scss'; index.scss @import '~lib/index.scss'; It's the problem of |
Ah ha! Straight from the horse's mouth, this is the correct way to import external styles into a Vue component: <style lang="scss" src="lib/index.scss"></style> |
Version
4.4.6
Reproduction link
https://github.com/diachedelic/vue-cli-scss-repro
Environment info
Steps to reproduce
Also see this diff with the scaffolded app.
What is expected?
vue-cli-service build
should succeedWhat is actually happening?
Relative paths to assets in SASS should be resolved relative to the SCSS file, regardless of whether it is in the same module as the Vue CLI app. You can see in
vanilla-app
, which does not use the vue-cli, that the asset is resolved.The text was updated successfully, but these errors were encountered: