Questions tagged [sass-loader]

435 questions
349
votes
17 answers

TypeError: this.getOptions is not a function

I am facing a weird error when I installed Bootstrap. The error is below. I tried uninstalling less-loader and installing less-loader@5.0.0, because I saw it online, but it did nothing. I am unsure what to do at this step. Syntax Error: TypeError:…
Juliette
  • 4,309
  • 2
  • 14
  • 31
46
votes
4 answers

webpack (with sass-loader) - scss file @import does not recognize resolve alias

My project structure: webpack.config.js app-- --> src ---->> components ------>>> myComponent.js ------>>> myComponent.scss --> styles ---->> variables.scss In webpack.config module.exports: ... resolve: { alias: { …
tome
  • 1,136
  • 2
  • 8
  • 25
36
votes
1 answer

Slow sass-loader Build Times with Webpack

Summary When we switched to using Webpack for handling our SASS files, we noticed that our build times in some cases became really slow. After measuring the performance of different parts of the build using the SpeedMeasurePlugin, it seems that…
mc92
  • 475
  • 5
  • 10
32
votes
9 answers

Module not found: Error: Can't resolve 'sass-loader'

New to webpack. Trying to get sass-loader to play nice with my react project, have followed tutorials. Config seems correct, but result is always "Can't resolve 'sass-loader'". I suspect this is some glaringly obvious error, but no amount of…
paraxial
  • 441
  • 1
  • 4
  • 8
31
votes
1 answer

Webpack 4: mini-css-extract-plugin + sass-loader + splitChunks

I've the follow example configuration to use mini-css-extract-plugin with Webpack 4: entry: { a: ['./js/a.js', './scss/a.scss'], b: ['./js/b.js', './scss/b.scss'] }, module: { rules: [ [...], { test:…
Andrea Moraglia
  • 505
  • 2
  • 5
  • 9
29
votes
6 answers

Webpack Sass - cannot resolve images

I am trying to compile my Sass via webpack. Compiling normal sass is fine but I get an error. Module not found: Error: Can't resolve '../img/twitter.svg' in '/Users/Steve/mywebsite/scss' @…
LeBlaireau
  • 17,133
  • 33
  • 112
  • 192
29
votes
1 answer

Why am I not being able to compile SASS with Webpack?

I have the following modules in my Webpack config: module: { preLoaders: [ { test: /\.vue$/, loader: 'eslint', include: projectRoot, exclude: /node_modules/ }, { test: /\.js$/, …
PedroD
  • 5,670
  • 12
  • 46
  • 84
26
votes
3 answers

Webpack - sass loader cannot find images

The sass loader doc says: "If you're just generating CSS without passing it to the css-loader, it must be relative to your web root". So i did as it tells, I have my index.html in my project root, then I'm trying to load an image from my scss…
Luca Mormile
  • 1,177
  • 6
  • 19
  • 36
23
votes
2 answers

Getting error message Module build failed (from ./node_modules/sass-loader/dist/cjs.js) when running npm serve

I'm working on a Vue/Vuetify project for quite some time now. It all worked fine until yesterday. I had problems with using the vuetify component, so I decided to run npm install and re-install vuetify: bad idea. The problem is…
Jeroen Meijer
  • 379
  • 2
  • 3
  • 10
22
votes
7 answers

CSS error source-map information is not available at URL() declaration (found orphan CR, try removeCR option)

I am having a problem when I execute NPM start in my project. I get this error message: ./src/assets/base.scss…
21
votes
5 answers

Disable Dart SASS Warnings Produced By External Theme File

I have a third party SCSS file that I am including in my project, and Dart SASS is displaying a long list of warnings as a result. How can I disable the warnings for third party includes? I'm using Vue with Dart SCSS. Dart has a quietDeps option,…
Alex Wade
  • 659
  • 1
  • 7
  • 27
19
votes
1 answer

Css Loader vs Style Loader Vs Sass-Loader

I was little confused in differentiating sass-loader and css-loader while using import statement. As per my knowledge css loader resolve import statment(@import) and style-loader works on injecting style dynamically on your page. I am also using…
Bharat Sewani
  • 628
  • 2
  • 10
  • 18
16
votes
3 answers

node-sass and sass-loader - Module build failed: TypeError: this.getResolve is not a function at Object.loader

I am simply trying to follow a tutorial which tells me to install both node-sass and sass-loader. When I do I get the following error: ERROR Failed to compile with 1 errors …
Jethro Hazelhurst
  • 3,230
  • 7
  • 38
  • 80
15
votes
7 answers

Vue2 - Error: PostCSS received undefined instead of CSS string

i have this problem when trying to compile a Vue2 project Syntax Error: Error: PostCSS received undefined instead of CSS string @ ./src/assets/sass/main.scss 4:14-233 14:3-18:5 15:22-241 @ ./src/main.js @ multi…
MarioC
  • 2,934
  • 15
  • 59
  • 111
15
votes
10 answers

ERROR in Module build failed (from ./node_modules/sass-loader/lib/loader.js):

I'm running the following command: ng build --prod --aot --base-href ./ And receiving; ERROR in Module build failed (from ./node_modules/sass-loader/lib/loader.js): $clr-popover-box-shadow-color: rgba(clr-getColor(dark), 0.25); …
Allan Bowe
  • 12,306
  • 19
  • 75
  • 124
1
2 3
28 29