Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] [plugin-react-css-modules] Plugin/preset did not return an object #5968

Closed
madeleineostoja opened this issue Jun 17, 2018 · 2 comments · Fixed by #6067
Closed

[v2] [plugin-react-css-modules] Plugin/preset did not return an object #5968

madeleineostoja opened this issue Jun 17, 2018 · 2 comments · Fixed by #6067
Labels
help wanted Issue with a clear description that the community can help with. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change

Comments

@madeleineostoja
Copy link

Description

Just upgraded to the v2 beta and all went well except for gatsby-plugin-react-css-modules, which is causing the new Babel setup to throw.

Basic error is:

here ./.cache/develop-static-entry.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: [BABEL] /{...}/.cache/develop-static-entry.js: Plugin/Preset did not return an object.

Can provide a full stacktrace if it'd help, but it's pretty opaque. Only narrowed it down to react-css-modules through a process of elimination with my plugins.

Also noticed that it now requires a peer dep of react-css-modules, when I thought it was built on babel-plugin-react-css-modules?

Steps to reproduce

Include gatsby-plugin-react-css-modules in a Gatsby v2 build

Environment


  System:
    OS: macOS High Sierra 10.13.4
    CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Shell: 5.5.1 - /usr/local/bin/zsh
  Binaries:
    Node: 9.0.0 - /usr/local/bin/node
    npm: 6.1.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 67.0.3396.87
    Firefox: 60.0.1
    Safari: 11.1
  npmPackages:
    gatsby: ^2.0.0-beta.1 => 2.0.0-beta.1
    gatsby-image: ^2.0.0-beta.1 => 2.0.0-beta.1
    gatsby-plugin-favicon: ^2.1.1 => 2.1.1
    gatsby-plugin-manifest: ^2.0.2-beta.1 => 2.0.2-beta.1
    gatsby-plugin-netlify: ^2.0.0-beta.1 => 2.0.0-beta.1
    gatsby-plugin-nprogress: ^2.0.0-beta.1 => 2.0.0-beta.1
    gatsby-plugin-offline: ^2.0.0-beta.1 => 2.0.0-beta.1
    gatsby-plugin-react-css-modules: ^2.0.0-beta.1 => 2.0.0-beta.1
    gatsby-plugin-react-helmet: ^3.0.0-beta.1 => 3.0.0-beta.1
    gatsby-plugin-segment: ^1.0.2 => 1.0.2
    gatsby-plugin-sharp: ^2.0.0-beta.1 => 2.0.0-beta.1
    gatsby-plugin-svgr: ^1.0.0 => 1.0.1
    gatsby-source-prismic: ^2.0.0-alpha.1 => 2.0.0-alpha.1
    gatsby-transformer-sharp: ^2.1.1-beta.1 => 2.1.1-beta.1
  npmGlobalPackages:
    gatsby-cli: 2.0.0-beta.1
@madeleineostoja
Copy link
Author

madeleineostoja commented Jun 18, 2018

Changing this line https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-react-css-modules/src/gatsby-node.js#L3 to 'babel-plugin-react-css-modules' fixes the error (and it trying to import react-css-modules rather than the babel plugin) but now my site isn't building properly anyway, so can't tell if react-css-modules is actually working.

This issue would suggest there are compat issues with Babel 7 regardless

@m-allanson m-allanson added help wanted Issue with a clear description that the community can help with. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change labels Jun 19, 2018
@madeleineostoja
Copy link
Author

Got my site building again, can confirm that ^ fixes the issue. Will submit a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants