Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js)

In the folder app, I created a folder styles > custom > loader.scss. Then, in the styles.scss file, I add this import:

@import "styles/custom/loader.scss";

The problem is that I have an error message:

./src/styles.scss - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):

@import "styles/custom/loader.scss";

I don’t know how can I solve this problem, please.

Files structure:

enter image description here

I don’t know how can I solve this problem please?

>Solution :

You are using an incorrect path based on how your files are structured. Try doing so instead:

@import "./app/styles/custom/loader.scss";

Leave a Reply