ERROR with compiling sass file
See original GitHub issueI’ve migrated webpack from 4 to 5. Running into issues with sass loader. How to approach this problem?
module: {
rules: [
{
test: /\.worker\.ts$/,
use: ['workerize-loader'],
exclude: path.resolve(__dirname, 'node_modules'),
},
{
test: /\.(ts|js)x?$/,
exclude: /node_modules/,
use: ['awesome-typescript-loader'],
enforce:'pre'
},
{
test: /\.html$/,
use: ['html-loader']
},
{
test: /\.s[ac]ss$/i,
use: [
"style-loader",
"css-loader",
{
loader: "sass-loader",
options: {
// Prefer `dart-sass`
implementation: require("sass"),
sassOptions: {
fiber: false,
},
},
},
],
},
{
test: /\.(png|woff|woff2|eot|ttf|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: ['url-loader']
}
],
},
resolve: {
'extensions': ['.js', '.jsx', '.ts', '.tsx']
},
ERROR in ./assets/scss/index/index_PA.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.js??ruleSet[1].rules[3].use[2]!./node_modules/file-loader/dist/cjs.js??ruleSet[1].rules[6].oneOf[1]!./assets/scss/index/index_PA.scss) Module build failed (from ./node_modules/sass-loader/lib/loader.js):
@import ‘…/vendors/bootstrap-4.3.1/css/bootstrap’; ^ Expected “{”. ╷ 1 │ export default webpack_public_path + “static/media/index_PA.c1419108.scss”; │ ^ ╵ stdin 1:79 root stylesheet in /Users/spa/assets/scss/index/index_PA.scss (line 1, column 79)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to resolve this Sass compiling error? - css - Stack Overflow
the error says that there's no container.scss file or it's unreachable and you're trying to import it, check typos for the file name...
Read more >Sass compilation error - HTML-CSS - The freeCodeCamp Forum
I try to compile my sass code to css using the command: “npm run compile_sass” but keeps getting this error message below:
Read more >Sass: @error
It prints the value of the expression (usually a string) along with a stack trace indicating how the current mixin or function was...
Read more >Compile sass Error: File to read not found or unreadable #2022
First make sure the file is there. ... When the sass file is modified for the first time will be prompted to save...
Read more >CSS Compile Error - Material Design for Bootstrap
Hello, I am trying to set the order of SCSS files in my main SCSS file. I'd like to compile in the following...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@priya454
Here template https://github.com/webpack-contrib/sass-loader/issues/new?assignees=&labels=&template=BUG.md
Based on error message, look at
file-loader
/css-loader
/etc works, they should have the right order, i.e. firstlyfile-loader
, thencss-loader
, thensass-loader
and etcNote:
file-loader
is deprecated (they still will work for webpack v5), but I strongly recommend migrate on https://webpack.js.org/guides/asset-modules/ (better support, more abilities, faster, no extra deps).@alexander-akait I added “file-loader” before style-loader and css-loader. It fixed the issue. But can you explain how you figured out that “file-loader” is missing