@material/animation stylesheet using Sass modules. ERROR in ./src/scss/main.scss
Module build failed:
@use "@material/animation";
^
Can't find stylesheet to import.
â•·
11 │ @use "@material/animation";
The stylesheet should import. I was able to get this to work by downgrading to version 4, however the docs are dated.
| Software | Version(s) |
| ---------------- | ---------- |
| MDC Web | 5.1.0
| Browser | Chrome / Terminal
| Operating System | Mac OS 10.13.6
Looks like the @material/animation node module is not exporting a stylesheet ðŸ˜
Looks like it is distributed with an index file (https://unpkg.com/@material/[email protected]/_index.scss) and works when I compile locally. This is most likely one of two issues:
You may be using node-sass instead of sass, which does not support Sass modules. The solution is to uninstall node-sass and install sass, it's a drop-in replacement.
You may be using webpack's sass-loader which has a known issue (https://github.com/webpack-contrib/sass-loader/issues/804). The workaround is to use webpackImporter: false as described in https://github.com/webpack-contrib/sass-loader/issues/804#issuecomment-586095020
Closing since I'm able to compile locally. Please comment if you're still having trouble and neither of those solutions work!
Option 2 was the solution, thanks!
Most helpful comment
Looks like it is distributed with an index file (https://unpkg.com/@material/[email protected]/_index.scss) and works when I compile locally. This is most likely one of two issues:
You may be using
node-sassinstead ofsass, which does not support Sass modules. The solution is to uninstallnode-sassand installsass, it's a drop-in replacement.You may be using webpack's
sass-loaderwhich has a known issue (https://github.com/webpack-contrib/sass-loader/issues/804). The workaround is to usewebpackImporter: falseas described in https://github.com/webpack-contrib/sass-loader/issues/804#issuecomment-586095020Closing since I'm able to compile locally. Please comment if you're still having trouble and neither of those solutions work!