Node module doesn't import file as expected

Viewed 45

Error message - @import "@material/elevation/mixins";

  File to import not found or unreadable: @material/elevation/mixins.

How the file looks - _mixins.scss

How the file gets imported in the node modules - @import "@material/elevation/mixins";

But the problem I see is that in the file mixins are created like "underscore" mixins and in the node module it is imported without the "underscore", I have tried deleting the node modules and reinstalling it, didn't work, the only thing that worked was to manually insert the "_" everywhere that mixins are used and that worked, but that isn't a viable solution, does anyone have an idea what is happening, this is an old project, running on node 14 and node-sass 4.14.1.

1 Answers

I assume your build system is Webpack-based. In that case, you need to prefix node_modules dependencies' paths with ~

Related