Gatsby: [bug] Generating SSR bundle fails

Created on 2 Dec 2019  路  8Comments  路  Source: gatsbyjs/gatsby

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

Most helpful comment

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.

All 8 comments

Hi, so this issue might be causing it:

https://github.com/zloirock/core-js/issues/710

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

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.

Just, npm Install

Yeah, i was trying with yarn

Just, npm Install

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.

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.

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
Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikestopcontinues picture mikestopcontinues  路  3Comments

ghost picture ghost  路  3Comments

andykais picture andykais  路  3Comments

kalinchernev picture kalinchernev  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments