Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 (webpack)-dev-server/client?http://192.168.1.202:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

I have tried to rebuild the sass-loader with no success.

My node version is v16.6.1 My NPM version is 7.21.0

Webpack is 5.1.2 and the sass-loader version is 10.2.0

This is a VUE2 project and all started when i started a new Vue3 project and i had to upgrade the vue/cli but i cannot understand how to go back locally (if this is the problem)

like image 726
MarioC Avatar asked Dec 01 '25 11:12

MarioC


2 Answers

Try it

npm install node-sass
or 
npm rebuild node-sass

I got answer for here

like image 75
grovskiy Avatar answered Dec 03 '25 20:12

grovskiy


Solved by first uninstalling node-sass:

yarn remove node-sass

And then installing sass instead:

yarn add -D sass

like image 43
W.M. Avatar answered Dec 03 '25 22:12

W.M.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!