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 [email protected], because I saw it online, but it did nothing. I am unsure what to do at this step.
Syntax Error: TypeError: this.getOptions is not a function
@ ./node_modules/vue-style-loader??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/vue-loader-v16/dist/stylePostLoader.js!./node_modules/postcss-loader/src??ref--8-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=scss 4:14-419 14:3-18:5 15:22-427
@ ./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=scss
@ ./src/App.vue
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.1.182:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
Similar to what @KostDM said, in my case it seems like [email protected]
doesn't work with [email protected]
.
I installed [email protected]
and it worked like a charm again.
In your package.json
:
"sass-loader": "^10",
I had the same problem resolved by downgrading sass-loader to 10.1.1. I am using @vue/cli 4.5.8 that includes [email protected].
From v11.0.0 of sass-loader and v8.0.0 of less-loader, the
minimum supported webpack version is 5
- sass-loader v11.0.0 release notes
- less-loader v8.0.0 release notes
Downgrading the sass-loader to ^10.0.0 worked for me, but on a fresh Nuxt.js CLI application I had to also install Sass with:
npm i sass
To downgrade, you can remove the node_modules
folder and to add, run this in your terminal:
npm i sass-loader@10
This will install the newest 10 version of sass-loader.
And after all, again install all dependencies:
npm i
EDIT
Sass-loader versions higher than 10 requires webpack 5
For me it helped to downgrade postcss-loader
+ "postcss-loader": "^4.2.0",
- "postcss-loader": "^5.0.0",
Yesterday I found a problem after upgrading sass-loader to the latest version.
If using yarn, you can downgrade sass-loader. Use yarn add sass-loader@^10.1.1 it work.