-
-
Notifications
You must be signed in to change notification settings - Fork 429
Closed
Labels
Description
- Operating System: Mac OS
- Node Version: v10.16.3
- NPM Version: v6.13.4
- webpack Version: v4.41.5
- sass-loader Version: v8.0.2
- dart-sass version: v1.25.0
Expected Behavior
Expected sass-loader
to resolve the module when _index.scss
files are used.
Actual Behavior
sass-loader
throws following error when @import
'ed Sass file contain @forward
statement with _index file. (See reproducible steps below).
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
Code
See complete example here:
https://github.com/abhiomkar/sass-module-bug
How Do We Reproduce?
git clone [email protected]:abhiomkar/sass-module-bug.git
cd sass-module-bug
npm i
npx webpack
Notice the error:
[./fixture-import.scss] 434 bytes {main} [built] [failed] [1 error]
ERROR in ./fixture-import.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
╷
1 │ @forward "@material/base" as mdc-base-*;
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
node_modules/@material/button/_mixins.import.scss 1:1 @import
/Users/abhiomkar/code/sass-bug-module/fixture-import.scss 1:9
Changing webpack entry file fixture-import.scss
=> fixture-use.scss
would fix the error.
UPDATE: See this comment for temporary workaround.
trimox, AlahmadiQ8, kallydev, fetters5, ForestKatsch and 24 more