question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Webpack] Invalid CSS after "@include mixins"

See original GitHub issue

Bug report

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

Steps to reproduce

1 Create a Example Project like this. https://github.com/material-components/material-components-web/blob/master/docs/getting-started.md 2. update mdc: npm i material-components-web@5.0.0-canary.faa9af310.0 3. run npm: npm start

Your Environment:

Software Version(s)
MDC Web 5.0.0-canary.faa9af310.0
Browser chrome
Operating System Debian 10

Possible solution

The only way to fix both problems, go to version 2.3.1.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:21 (6 by maintainers)

github_iconTop GitHub Comments

27reactions
abrahamcommented, Feb 14, 2020

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 sass@1.25.0.

7reactions
abhiomkarcommented, Feb 19, 2020

I created full working example with some of the popular bundlers: Webpack, Rollup & Snowpack.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SassError: Invalid CSS after "@include mat": expected 1 ...
I fixed it by removing node sass all together. npm uninstall node-sass.
Read more >
sasserror: invalid css after - You.com | The search engine you ...
When you use @import with SCSS you get one stylesheet copied into your primary styles. As this happens before the compile is complete...
Read more >
Sass: @use
The @use rule loads mixins, functions, and variables from other Sass stylesheets, and combines CSS from multiple stylesheets together.
Read more >
sass-loader - webpack - JS.ORG
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
Using @use With Sass and Webpack
"Sass extends CSS's @import rule with the ability to import Sass and CSS ... SassError: Invalid CSS after "...y-bg: variables": expected ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found