Tag Archives: PHP Syntax error

Syntax error: typeerror: about installing sass in vue3 this.getOptions is not a function

Vue3 successfully installed sass, but the following error occurred during compilation


 ERROR  Failed to compile with 1 error                                                                            PM 1:05:09

 error  in ./src/components/HelloWorld.vue?vue&type=style&index=0&id=469af010&lang=scss

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/[email protected]@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/components/HelloWorld.vue?vue&type=style&index=0&id=469af010&lang=scss 4:14-464 15:3-20:5 16:22-472
 @ ./src/components/HelloWorld.vue?vue&type=style&index=0&id=469af010&lang=scss
 @ ./src/components/HelloWorld.vue
 @ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/App.vue?vue&type=script&lang=js
 @ ./src/App.vue?vue&type=script&lang=js
 @ ./src/App.vue
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.31.108:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

Cause of the problem

When the above error occurs, it is found that the version of SASS loader is too high, so the above problem occurs in the compilation

resolvent

We need to unload

cnpm uninstall less-loader

After reinstalling

cnpm i [email protected] --save-dev

Finally, it is compiled successfully