hupe1980 / gatsby-plugin-material-ui

Gatsby plugin for Material-UI with built-in server-side rendering support
MIT License
136 stars 24 forks source link

Build Error after upgrade: WebpackError: CssSyntaxError #26

Closed alanpog closed 5 years ago

alanpog commented 5 years ago

After upgrading gatsby-theme-material-ui, which upgraded gatsby-plugin-material-ui to 2.0.1, I'm getting the following build error (only with gatsby build not with develop):

  WebpackError: CssSyntaxError: <css input>:3417:7: Unknown word

  - input.js:130 Input.error
    [lib]/[gatsby-plugin-material-ui]/[postcss]/lib/input.js:130:1

  - parser.js:563 Parser.unknownWord
    [lib]/[gatsby-plugin-material-ui]/[postcss]/lib/parser.js:563:1

  - parser.js:235 Parser.decl
    [lib]/[gatsby-plugin-material-ui]/[postcss]/lib/parser.js:235:1

  - parser.js:133 Parser.other
    [lib]/[gatsby-plugin-material-ui]/[postcss]/lib/parser.js:133:1

  - parser.js:77 Parser.parse
    [lib]/[gatsby-plugin-material-ui]/[postcss]/lib/parser.js:77:1

  - parse.js:17 parse
    [lib]/[gatsby-plugin-material-ui]/[postcss]/lib/parse.js:17:1

  - lazy-result.js:60 new LazyResult
    [lib]/[gatsby-plugin-material-ui]/[postcss]/lib/lazy-result.js:60:1

  - processor.js:138 Processor.<anonymous>
    [lib]/[gatsby-plugin-material-ui]/[postcss]/lib/processor.js:138:1

  - processor.js:117 Processor.process
    [lib]/[gatsby-plugin-material-ui]/[postcss]/lib/processor.js:117:1

  - gatsby-ssr.js:50 Object.onRenderBody
    [lib]/[gatsby-plugin-material-ui]/gatsby-ssr.js:50:1

  - api-runner-ssr.js:43 
    lib/.cache/api-runner-ssr.js:43:20

  - api-runner-ssr.js:39 ./.cache/api-runner-ssr.js.module.exports
    lib/.cache/api-runner-ssr.js:39:17

  - static-entry.js:261 Module../.cache/static-entry.js.__webpack_exports__.defa    ult
    lib/.cache/static-entry.js:261:3

  - bootstrap:24 Promise
    lib/webpack/bootstrap:24:1
hupe1980 commented 5 years ago

@alanpog Could you provide a reproduction?

develowlper commented 5 years ago

Hey @alanpog.

I ran into the same issue. Here is a workaround for gatsby-config.js

    {
      resolve: `gatsby-plugin-material-ui`,
      options: {
        disableAutoprefixing: true,
        disableMinification: true,
      },
    },

It looks like there is an issue with the postcss and clean-css stuff when the site builds. When I find some time I will try to create a reproduction.

hupe1980 commented 5 years ago

@alanpog @develowlper Any updates?

hupe1980 commented 5 years ago

First closed, because error are not reproducible. If the error occurs again, just open a new ticket