Here is the full project on Github
I run gatsby develop and here is the full console output
gatsby develop
success open and validate gatsby-configs - 0.042s
success load plugins - 0.462s
success onPreInit - 0.012s
success initialize cache - 0.045s
success copy gatsby files - 0.240s
success onPreBootstrap - 0.062s
success createSchemaCustomization - 0.018s
success source and transform nodes - 0.165s
success building schema - 0.502s
success createPages - 0.066s
success createPagesStatefully - 0.334s
success onPreExtractQueries - 0.004s
success update schema - 0.069s
success extract queries from components - 0.204s
success write out requires - 0.043s
success write out redirect data - 0.012s
success onPostBootstrap - 0.011s
โ
info bootstrap finished - 10.645 s
โ
success run queries - 0.047s - 3/3 63.54/s
ERROR #98123 WEBPACK
Generating SSR bundle failed
Cannot find module '@babel/core'
Require stack:
- /Dir/node_modules/@babel/plugin-transform-react-jsx/lib/transform-classic.js
- /Dir/node_modules/@babel/plugin-transform-react-jsx/lib/index.js
- /Dir/node_modules/@emotion/babel-preset-css-prop/dist/babel-preset-css-prop.cjs.dev.js
- /Dir/node_modules/@emotion/babel-preset-css-prop/dist/babel-preset-css-prop.cjs.js
- /Dir/tutorial-part-four/node_modules/@babel/core/lib/config/files/plugins.js
- /Dir/tutorial-part-four/node_modules/@babel/core/lib/config/files/index.js
- /Dir/tutorial-part-four/node_modules/@babel/core/lib/index.js
- /Dir/tutorial-part-four/node_modules/babel-loader/lib/index.js
- /Dir/tutorial-part-four/node_modules/gatsby/dist/utils/babel-loader.js
- /Dir/tutorial-part-four/node_modules/loader-runner/lib/loadLoader.js
- /Dir/tutorial-part-four/node_modules/loader-runner/lib/LoaderRunner.js
- /Dir/tutorial-part-four/node_modules/webpack/lib/NormalModule.js
- /Dir/tutorial-part-four/node_modules/webpack/lib/NormalModuleFactory.js
- /Dir/tutorial-part-four/node_modules/webpack/lib/Compiler.js
- /Dir/tutorial-part-four/node_modules/webpack/lib/webpack.js
- /Dir/tutorial-part-four/node_modules/gatsby/dist/commands/develop.js
- ~/.config/yarn/global/node_modules/gatsby-cli/lib/create-cli.js
- ~/.config/yarn/global/node_modules/gatsby-cli/lib/index.js
File: .cache/develop-static-entry.js
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
3 pages Failed gatsby-starter-hello-world
Failed attempts so far
I've tried deleting .cache, node_modules yarn.lock/package-lock.json and reinstalling. I tried this using both npm and yarn (separately, never together), and upgrading yarn, and node
I also tried
rm ~/Library/Yarn/Caches/
yarn add @babel/core
and receive
yarn add @babel/core
yarn add v1.22.4
warning ../package.json: No license field
[1/4] ๐ Resolving packages...
[2/4] ๐ Fetching packages...
warning Pattern ["@babel/core@^7.9.0"] is trying to unpack in the same destination "~/Library/Caches/Yarn/v6/npm-@babel-core-7.9.0-ac977b538b77e132ff706f3b8a4dbad09c03c56e-integrity/node_modules/@babel/core" as pattern ["@babel/core@^7.8.7"]. This could result in non-deterministic behavior, skipping.
warning [email protected]: Invalid bin field for "url-loader".
[3/4] ๐ Linking dependencies...
[4/4] ๐จ Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
โโ @babel/[email protected]
info All dependencies
โโ @babel/[email protected]
โจ Done in 164.67s.
Yarn, node and Gatsby version
yarn --version
1.22.4
node --version
v13.13.0
gatsby --version
Gatsby CLI version: 2.11.7
Gatsby version: 2.20.20
Note: this is the Gatsby version for the site at: /Dir/tutorial-part-four
downgrading to gatsby version 2.20.19 worked for me.
Only way I made to work was installing webpack as devDependency in my project.
Thanks for reporting! This is the same as https://github.com/gatsbyjs/gatsby/issues/23127
Upgrading to [email protected] should fix it.
Awesome. Thanks for the update @LekoArts
It's crappy that this exists as an error on the tutorial. I'm stuck on it, tried to upgrade.
@geoguide is this the problem still exists?
I'm not a maintainer but I would suggest either you open a PR to fix that in the tutorial or an issue so that people are aware about this problem still persist.
@raulfdm Good idea. I don't have time to start over and open the issue now, kind of gave up on gasby after hitting a wall on the tutorial. Maybe will give it a shot after work.
@geoguide My website is running under gatsby and a bunch of tooling (https://github.com/raulfdm/raulmelo.dev). Maybe I can help you with this hassles!
I just tried it again today (Tutorial Part 4) and still get the problem. I tried
gatsby clean@babel/core since the message says it's missing.webpack since it helped raulfdm above.webpack and @babel/core at the same timeBut I continue to receive
sites/gatsby/part-four$ gatsby build
. . . . . snip . . . . .
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
Cannot find module '@babel/core'
File: .cache/production-app.js
My partial config is
System:
OS: macOS Mojave 10.14.6
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.18.1 - ~/.nvm/versions/node/v10.18.1/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - ~/.nvm/versions/node/v10.18.1/bin/npm
npmPackages:
gatsby: ^2.20.22 => 2.20.22
npmGlobalPackages:
gatsby-cli: 2.12.38
I don't have this problem with Tutorial parts 1 - 3. I also did not encounter these symptoms in Part 4 before adding the files.
for me, this error was something to do with not being able to find something in prettier, as opposed to babel, though the code was the same. The issue was VS Code automatically creating an import (offscreen) from a typo when I was in the middle writing a function, and VS Code figured I wanted to import some module, when in fact I did not. I checked through my files and found a stray import { someFunc } from 'prettier' which didn't belong - upon removing this, the error went away.
@pglezen @geoguide were you ever able to move past this?
I did succeed after upgrading a week or so later. Now my gatsby versions are:
npmPackages:
gatsby: ^2.23.4 => 2.23.4
npmGlobalPackages:
gatsby-cli: 2.12.52
Most helpful comment
It's crappy that this exists as an error on the tutorial. I'm stuck on it, tried to upgrade.