webpackvue-cli-4

vue-cli (webpack) unexpected character


I have an issue with sass files (when I remove sass files all build process pass successfully), the error is:

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleParseError: Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently, no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

As I understand I need to add some loader to my vue.config.js, but I do not understand what exactly loader I need to add?? From the error, it's not clear which file/line exactly causing the issue (I have several scss files)


Solution

  • Install sass loader and node-sass

    Run npm install -D sass-loader node-sass. You can see more here