Generating SSR bundle failed saying it's not possible to compile spread arguments in `super()` without compiling classes
See original GitHub issueDescription
gatsby build is failing with the error:-
error Generating SSR bundle failed
/builds/anant-ag/kompanero/src/components/AddressFormModal.js:
It's not possible to compile spread arguments in `super()` without compiling classes.
Here’s the screenshot of the build logs:-
Steps to reproduce
Clone https://github.com/pieh/i29326 and use steps from README of that repo
Expected result
Build should be successful
Actual result
Build failed
Environment
Run gatsby info --clipboard
in your project directory and paste the output here.
System: OS: Windows 10 10.0.18363 CPU: (8) x64 Intel® Core™ i5-8250U CPU @ 1.60GHz Binaries: Node: 14.15.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD Languages: Python: 2.7.15 Browsers: Chrome: 88.0.4324.146 Edge: Spartan (44.18362.449.0) npmPackages: gatsby: 2.32.0 => 2.32.0 gatsby-image: 2.11.0 => 2.11.0 gatsby-link: 2.11.0 => 2.11.0 gatsby-plugin-canonical-urls: 2.10.0 => 2.10.0 gatsby-plugin-google-gtag: 2.8.0 => 2.8.0 gatsby-plugin-layout: 1.10.0 => 1.10.0 gatsby-plugin-lunr: 1.5.2 => 1.5.2 gatsby-plugin-manifest: 2.12.0 => 2.12.0 gatsby-plugin-no-sourcemaps: 2.9.0 => 2.9.0 gatsby-plugin-preconnect: ^1.1.54 => 1.1.54 gatsby-plugin-react-helmet: 3.10.0 => 3.10.0 gatsby-plugin-remove-serviceworker: 1.0.0 => 1.0.0 gatsby-plugin-robots-txt: 1.5.5 => 1.5.5 gatsby-plugin-sharp: 2.14.0 => 2.14.0 gatsby-plugin-sitemap: 2.12.0 => 2.12.0 gatsby-source-filesystem: 2.11.0 => 2.11.0 gatsby-source-shopify: 3.10.0 => 3.10.0 gatsby-transformer-sharp: 2.12.0 => 2.12.0 npmGlobalPackages: gatsby-cli: 2.12.91
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:25 (3 by maintainers)
Top GitHub Comments
Really! I didn’t know this selection of yarn dependencies. Thanks for the help and clarification!
In the end, I solved it this way:
Run commands
gatsby clean
rm -rf yarn.lock
rm -rf node_modules/
yarn add @babel/plugin-transform-spread@7.12.1
Add
resolutions
inpackage.json
fileLet’s test!
yarn install
gatsby build
After correcting this ‘bug’, I will need to
remove
theresolutions
and the dependency"@babel/plugin-transform-spread": "7.12.1"
, correct @Pessimistress?There’s no reproduction needed, all our sites used to build but no longer do.
As @Pessimistress mentioned,
@babel/plugin-transform-spread
pushed a patch that broke many things, I think Gatsby just needs to lock the version.The one-line fix is:
npm i @babel/plugin-transform-spread@7.12.1
But Gatsby itself badly needs to lock the version otherwise you’re going to get a whole lot of people opening issues.