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

[bug] Generating SSR bundle fails #19922

Closed
daydream05 opened this issue Dec 2, 2019 · 8 comments
Closed

[bug] Generating SSR bundle fails #19922

daydream05 opened this issue Dec 2, 2019 · 8 comments

Comments

@daydream05
Copy link
Contributor

daydream05 commented Dec 2, 2019

Description

When running gatsby develop I get a webpack ERROR #98123
It also adds that babel Cannot find module './src/data'

Steps to reproduce

I tried reproducing to no avail. What I did that led me here was update from [email protected] to [email protected]. I also updated my react & react-dom package to 16.2.0

It seems that the file causing this is File: .cache/develop-static-entry.js

Which uses(?) node_modules/core-js-compat/helpers.js. This helper is the one looking for ./src/data

Expected result

Gatsby should develop locally.

Actual result

Generating SSR bundle failed

Environment

System:
    OS: macOS High Sierra 10.13.6
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.7.0 - /usr/local/bin/node
    Yarn: 1.16.0 - ~/.yarn/bin/yarn
    npm: 6.10.3 - /usr/local/bin/npm
  Languages:
    Python: 2.7.10 - /usr/bin/python
  npmPackages:
    gatsby: ^2.18.6 => 2.18.6
    gatsby-image: ^2.2.6 => 2.2.34
    gatsby-plugin-canonical-urls: ^2.1.2 => 2.1.16
    gatsby-plugin-catch-links: ^2.1.9 => 2.1.19
    gatsby-plugin-feed: 2.1.0 => 2.1.0
    gatsby-plugin-google-analytics: 2.0.18 => 2.0.18
    gatsby-plugin-html-attributes: ^1.0.5 => 1.0.5
    gatsby-plugin-manifest: ^2.2.3 => 2.2.31
    gatsby-plugin-netlify: 2.0.13 => 2.0.13
    gatsby-plugin-nprogress: 2.0.10 => 2.0.10
    gatsby-plugin-offline: ^2.2.4 => 2.2.10
    gatsby-plugin-react-helmet: ^3.1.2 => 3.1.16
    gatsby-plugin-react-svg: ^2.1.1 => 2.1.2
    gatsby-plugin-sharp: ^2.2.8 => 2.3.5
    gatsby-plugin-sitemap: 2.0.10 => 2.0.10
    gatsby-plugin-styled-components: ^3.1.2 => 3.1.14
    gatsby-plugin-typography: 2.2.10 => 2.2.10
    gatsby-plugin-web-font-loader: ^1.0.4 => 1.0.4
    gatsby-remark-external-links: 0.0.4 => 0.0.4
    gatsby-remark-images-contentful: ^2.1.11 => 2.1.25
    gatsby-remark-prismjs: 3.2.6 => 3.2.6
    gatsby-source-contentful: ^2.1.14 => 2.1.66
    gatsby-source-filesystem: ^2.1.5 => 2.1.40
    gatsby-transformer-remark: 2.3.8 => 2.3.8
    gatsby-transformer-sharp: ^2.2.4 => 2.3.6
  npmGlobalPackages:
    gatsby-cli: 2.8.13
@daydream05
Copy link
Contributor Author

Hi, so this issue might be causing it:

zloirock/core-js#710

@daydream05
Copy link
Contributor Author

So updating core-js-compat to3.4.7 would solve this issue

@daydream05
Copy link
Contributor Author

daydream05 commented Dec 2, 2019

Update:
So this issue was specifically for the time when core-js-compat broke. But I think you might be having the same issue if any of the gatsby dependencies break.

As many have mentioned, delete your package-lock.json or yarn.lock, as well as your node_modules then reinstall everything.

@mdjeelan
Copy link

Just, npm Install

@matheusfaggi
Copy link

Yeah, i was trying with yarn

Just, npm Install

@benjamin-lester
Copy link

Deleting node_modules and running npm i from the working folder of my site did the trick for me. node_modules was previously located one level up, in the parent directory of my site's folder, which was causing the error.

@cezarcarvalhaes
Copy link

I ran into this exact issue, but my issue was due to inconsistent node versions. Deleting node_modules and running npm i didn't fix it for me. I was on node v12.18, but jumping back to node v12.16 and deleting node_modules and reinstalling finally fixed it.

@boda-sh
Copy link
Contributor

boda-sh commented Nov 1, 2020

Not just a reinstall issue, I also had to use npm instead of yarn to fix it

  • remove node_modules
  • delete yarn.lock
  • reinstall with npm i

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants