Hello,
I try to pack mdc with Webpack and Typscript.
In Version 4.0.0
I get this error:
ERROR in [at-loader] ./node_modules/@material/auto-init/index.d.ts:38:16
TS2528: A module cannot have multiple default exports.
This is fixed by Version: "^5.0.0-canary.faa9af310.0"
But now I have the error:
ERROR in ./src/frontend/sass/main.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Invalid CSS after "@include mixins": expected 1 selector or at-rule, was ".core-styles;"
on line 24 of node_modules/@material/button/mdc-button.scss
1 Create a Example Project like this.
https://github.com/material-components/material-components-web/blob/master/docs/getting-started.md
| Software | Version(s) |
| ---------------- | ---------- |
| MDC Web | 5.0.0-canary.faa9af310.0
| Browser | chrome
| Operating System | Debian 10
The only way to fix both problems, go to version 2.3.1.
This looks like a duplicate of #5158. A fix has been made, but I don't believe it's released yet.
Edit: Ah never mind, I see your actual problem is with sass!
I have the same problem (with the canary releases over npm and using webpack to generate the updated css) - can't find any examples of how to include the changed / new mixins?
it started 2-3 weeks ago. "5.0.0-canary.0d42ee650.0" seems to work - but no later versions.
I tested now the NPM releases.
The Problem is in release: 5.0.0-canary.faa9af310.0
Release 5.0.0-canary.a4db5fbad.0 works.
Looks like this commit make the problem: https://github.com/material-components/material-components-web/commit/faa9af310d1a18ec2c183830c84eb14d0492feab
Hi, MDC Web is not officially supported on Canary. We recommend using the @latest release.
... from my part it was not a support request - as I don't expect you to "support". However the feedback that is delivered here could potentially help improve the library and help the community too... @latest is currently 3 months behind (and projects using the mdc libraries are often not able to wait for 3 month for updates and improvements). Using canary at least give some interim fixes as well as avoid having major breaking changes hit you. As @canary releases are available on npm I think it is not unreasonable that some (including myself) have used "the latest" build before asking further questions or requesting new features. But in any case thanks for the feedback.
Hi, MDC Web is not officially supported on Canary. We recommend using the
@latestrelease.
Hi bonniezhou,
I try to use the @lastest version.
But I have this problem:
ERROR in [at-loader] ./node_modules/@material/auto-init/index.d.ts:38:16
TS2528: A module cannot have multiple default exports.
This is fixed in a Canary version. In the Moment I must use the mini.css file. And this make a lot of problems and I can't use the "power" of SCSS.
I not really understand why the canary visions are on NPM, if this Versions are not ready to use.
I will wait for the new Version, thanks for your feedback.
What version of sass are you using? That canary version is using sass modules, which may be why sass is failing to build.
If you're using an older version, a fix may be to update sass.
What version of sass are you using? That canary version is using sass modules, which may be why sass is failing to build.
If you're using an older version, a fix may be to update sass.
Hi AsyncLiz,
thanks for your message.
I use the Version [email protected].
This is the last version on NPM.
I was getting
ERROR in ./src/frontend/sass/main.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Invalid CSS after "@include mixins": expected 1 selector or at-rule, was ".core-styles;"
on line 24 of node_modules/@material/button/mdc-button.scss
and fixed it by removing node-sass and installing [email protected].
I was getting
ERROR in ./src/frontend/sass/main.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Invalid CSS after "@include mixins": expected 1 selector or at-rule, was ".core-styles;"
on line 24 of node_modules/@material/button/mdc-button.scssand fixed it by removing
node-sassand installing[email protected].
It worked .. Thanks
Hi @abraham
and fixed it by removing
node-sassand installing[email protected].
I get this error
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Two forwarded modules both define a variable named $mdc-feature-mdc-feature-all-features.
โท
2 โ @forward "@material/feature-targeting/variables" as mdc-feature-*;
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ original @forward
3 โ @forward "@material/feature-targeting/mixins" as mdc-feature-*;
โ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ new @forward
โต
node_modules/@material/card/mdc-card.import.scss 3:1 @import
@m-alzam same
@m-alzam same
Hi @abraham
and fixed it by removing
node-sassand installing[email protected].I get this error
Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Two forwarded modules both define a variable named $mdc-feature-mdc-feature-all-features. โท 2 โ @forward "@material/feature-targeting/variables" as mdc-feature-*; โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ original @forward 3 โ @forward "@material/feature-targeting/mixins" as mdc-feature-*; โ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ new @forward โต node_modules/@material/card/mdc-card.import.scss 3:1 @import
here is temporary solution: https://github.com/webpack-contrib/sass-loader/issues/804#issuecomment-586095020
I indeed have the same error and when I add the workaround it complains that it cannot find the stylesheet.
I created full working example with some of the popular bundlers: Webpack, Rollup & Snowpack.
I indeed have the same error and when I add the workaround it complains that it cannot find the stylesheet.
if you see the following

it means that the package is not installed
I was getting
ERROR in ./src/frontend/sass/main.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Invalid CSS after "@include mixins": expected 1 selector or at-rule, was ".core-styles;"
on line 24 of node_modules/@material/button/mdc-button.scssand fixed it by removing
node-sassand installing[email protected].
Hi @abraham
I get the same Error ...
ERROR in Module build failed (from ./node_modules/sass-loader/lib/loader.js):
@forward "@material/animation/variables" as mdc-animation-;
^
@forward is coming soon, but it's not supported in this version of Dart Sass.
โท
1 โ @forward "@material/animation/variables" as mdc-animation-;
Any solution?
CSS modules require sass@^1.23.0. Make sure you're on that version or later to use them.
If you're using sass-loader it will automatically use sass, but you'll need to make sure any traces of node-sass have been fully removed from the project.
If you're continuing to have problems, create a reproduction repository with your package.json and package-lock.json.
@m-alzam same
Hi @abraham
and fixed it by removing
node-sassand installing[email protected].I get this error
Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Two forwarded modules both define a variable named $mdc-feature-mdc-feature-all-features. โท 2 โ @forward "@material/feature-targeting/variables" as mdc-feature-*; โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ original @forward 3 โ @forward "@material/feature-targeting/mixins" as mdc-feature-*; โ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ new @forward โต node_modules/@material/card/mdc-card.import.scss 3:1 @importhere is temporary solution: webpack-contrib/sass-loader#804 (comment)
Works with sass ^1.26.10 and MDC 7.0.0
Most helpful comment
I was getting
and fixed it by removing
node-sassand installing[email protected].