gatsby: Error #98123 Webpack (Generating SSR bundle failed) - helper-compilation-targets

Description

I create gatsby new hello and I go to the folder hello cd hello and run gatsby develop, them I get error:

ERROR #98123  WEBPACK
Generating SSR bundle failed

[BABEL] /home/irek/node-p/gatsby/hello/.cache/develop-static-entry.js: Package exports for '/home/irek/node-p/gatsby/hello/node_modules/@babel/helper-compilation-targets' do not define a '.' subpath

File: .cache/develop-static-entry.js

Steps to reproduce

I found similar requests but it didn’t work. I updated my helper-compilation-targets, gatsby-cli It seems that the file causing this is file: .cache/develop-static-entry.js and with his subpath.

Expected result

Gatsby should start my localhost.

Actual result

Error #98123 WEBPACK Generating SSR bundle failed

Environment

System:
    OS: Linux 4.15 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (4) x64 Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 13.1.0 - ~/.nvm/versions/node/v13.1.0/bin/node
    Yarn: 1.22.0 - ~/.nvm/versions/node/v13.1.0/bin/yarn
    npm: 6.13.7 - ~/.nvm/versions/node/v13.1.0/bin/npm
  Languages:
    Python: 2.7.17 - /usr/bin/python
  Browsers:
    Chrome: 80.0.3987.116
    Firefox: 73.0
  npmPackages:
    gatsby: ^2.19.7 => 2.19.7
    gatsby-image: ^2.2.39 => 2.2.39
    gatsby-plugin-manifest: ^2.2.39 => 2.2.39
    gatsby-plugin-offline: ^3.0.32 => 3.0.32
    gatsby-plugin-react-helmet: ^3.1.21 => 3.1.21
    gatsby-plugin-sharp: ^2.4.3 => 2.4.3
    gatsby-source-filesystem: ^2.1.46 => 2.1.46
    gatsby-transformer-sharp: ^2.3.13 => 2.3.13
  npmGlobalPackages:
    gatsby-cli: 2.8.30

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 24 (4 by maintainers)

Most upvoted comments

I had the exact problem but solved by upgrading package via yarn upgrade

@varlevi you need node version min. 13.7+

Same problem with Node 12.6.1 I deleted .cache and node_modules and nothing happened. Deleting package-lock.json did the trick.

Thanks @elias-thok

I upgrade node version to 13.7+ and it solved problem.

Same problem here, started today all of a sudden. Error appears in node version 13.11, NPM-6.14.

Generating SSR bundle failed

/Users/test/repo/.cache/loader.js: Unknown helper createSuper

File: .cache/loader.js

Switching between node versions with n, as well as deleting node_modules & cache didn’t change anything.

Edit: After loosing a couple of hours on this, I’ll managed to get it running again, maybe this can help someone. Downgrading packages, switching yarn/npm, did not work. I believe deleting .cache, node_modules and (most importantly) package.lock.json did the trick. However, only for npm, error still happens when I use yarn.

If you add a custom babel file without using the gatsby preset, it will resolve in a similar error. Make sure you follow this docs.

Hi! I’m on node 13.10.1 and I’m still having this exact problem.

Environment

System:
    OS: Raspian Buster
  Binaries:
    Node: 13.10.1
    npm: 6.13.7
  Browsers:
    Vivaldi: 2.8.1664.44
  npmGlobalPackages:
    gatsby-cli: 2.10.2

Following this error is printed:

Generating SSR bundle failed

[BABEL] /home/<user>/Documents/programming/personal_website/web/.cache/develop-static-entry.js: No "exports" main resolved in /home/<user>/Documents/programming/personal_website/web/node_modules/@babel/helper-compilation-targets/package.json

File: .cache/develop-static-entry.js

If you add a custom babel file without using the gatsby preset, it will resolve in a similar error. Make sure you follow this docs.

@alexcanessa your comment helped me fix my issue. thanks!

I’m also hitting this issue, with Node 13.10.1 (and works with 12.16.1). https://github.com/nodejs/node/issues/32107 appears to the the nodejs issue tracking this

i just use node version 8.12.0 without this problem