1
resposta

Erro ao tentar rodar sass no projeto

Após instalar npm install node-sass@4.5.0 sass-loader@4.1.1 --save-dev fui rodar o comando npm run dev e tive erros:

7:1 Uncaught Error: Module build failed: TypeError: this.getResolve is not a function at Object.loader (F:\Front-End\VueJS\Projeto Vue Alura1\alurapic\node_modules\sass-loader\dist\index.js:52:26) at eval (webpack-internal:///7:1:7) at Object. (http://localhost:8080/dist/build.js:758:1) at webpack_require (http://localhost:8080/dist/build.js:660:30) at fn (http://localhost:8080/dist/build.js:86:20) at eval (webpack-internal:///74:4:15) at Object. (http://localhost:8080/dist/build.js:1185:1) at webpack_require (http://localhost:8080/dist/build.js:660:30) at fn (http://localhost:8080/dist/build.js:86:20) at eval (webpack-internal:///22:3:1) at Object. (http://localhost:8080/dist/build.js:850:1)

ERROR in .//css-loader!.//vue-loader/lib/style-rewriter.js?id=data-v-3d0df362!.//sass-loader/dist/cjs.js!.//vue-loader/lib/selector.js?type=styles&index=0!./src/components/shared/botao/Botao.vue Module build failed: TypeError: this.getResolve is not a function at Object.loader (F:\Front-End\VueJS\Projeto Vue Alura1\alurapic\node_modules\sass-loader\dist\index.js:52:26) @ .//vue-style-loader!.//css-loader!.//vue-loader/lib/style-rewriter.js?id=data-v-3d0df362!.//sass-loader/dist/cjs.js!.//vue-loader/lib/selector.js?type=styles&index=0!./src/components/shared/botao/Botao.vue 4:14-281 13:3-17:5 14:22-289 @ ./src/components/shared/botao/Botao.vue @ .//babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/components/home/Home.vue @ ./src/components/home/Home.vue @ ./src/routes.js @ ./src/main.js @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

1 resposta

Fala ai Lucas, tudo bem? Parece que ele não está encontrando algum resolver do Webpack.

Você fez as configurações do SASS no vue.config.js?

https://vue-loader.vuejs.org/guide/pre-processors.html#sharing-global-variables

Ele diz para criar o webpack.config.js, mas, pode ser sero vue.config.js, parecido com esse:

https://github.com/mahenrique94/miniviewer/blob/master/vue.config.js

Depois que configurar (caso não tenha configurado) o loader do SASS o problema deve resolver.

Espero ter ajudado.