Gatsby build fails - Can"t resolve "mitt" in "/opt/build/repo/.cache"

I’ve just finished migrating one of my sites from CRA to Gatsby. As well as changing build frameworks, I’ve also upgraded to Node 18 and moved from yarn to pnpm. I’ve updated my build settings to reflect this but keep getting the following errors on build. Any ideas?

Site is capability-charlotte (https://capabilitycharlotte.com), which is still running the old version.

Build settings and build logs are shown below:

7:53:16 PM: build-image version: 0143b4617dd9b5b3faed2aefa29c54a846e69aae (focal)
7:53:16 PM: buildbot version: 24f7c9fcfdc0e642a0e84524831960fde1f386d1
7:53:16 PM: Building without cache
7:53:16 PM: Starting to prepare the repo for build
7:53:17 PM: No cached dependencies found. Cloning fresh repo
7:53:17 PM: git clone --filter=blob:none git@gitlab.com:MorayM/capability-charlotte-com
7:53:17 PM: Preparing Git Reference refs/heads/main
7:53:27 PM: Custom publish path detected. Proceeding with the specified path: "public"
7:53:27 PM: Starting to install dependencies
7:53:27 PM: Python version set to 3.8
7:53:27 PM: Attempting Ruby version 2.7.1, read from environment
7:53:28 PM: Required ruby-2.7.1 is not installed - installing.
7:53:28 PM: Searching for binary rubies, this might take some time.
7:53:28 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.7.1.tar.bz2
7:53:28 PM: Checking requirements for ubuntu.
7:53:28 PM: Requirements installation successful.
7:53:28 PM: ruby-2.7.1 - #configure
7:53:28 PM: ruby-2.7.1 - #download
7:53:29 PM: ruby-2.7.1 - #validate archive
7:53:32 PM: ruby-2.7.1 - #extract
7:53:34 PM: ruby-2.7.1 - #validate binary
7:53:34 PM: ruby-2.7.1 - #setup
7:53:34 PM: ruby-2.7.1 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.1@global
7:53:34 PM: ruby-2.7.1 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems........................................
7:53:35 PM: ruby-2.7.1 - #generating global wrappers........
7:53:35 PM: ruby-2.7.1 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.1
7:53:35 PM: ruby-2.7.1 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
7:53:35 PM: ruby-2.7.1 - #generating default wrappers........
7:53:35 PM: Using /opt/buildhome/.rvm/gems/ruby-2.7.1
7:53:35 PM: Using Ruby version 2.7.1
7:53:36 PM: Started restoring cached go cache
7:53:36 PM: Finished restoring cached go cache
7:53:36 PM: Installing Go version 1.14.4 (requested 1.14.4)
7:53:41 PM: go version go1.14.4 linux/amd64
7:53:42 PM: Using PHP version 8.0
7:53:43 PM: v18.18.0 is already installed.
7:53:44 PM: Now using node v18.18.0 (npm v9.8.1)
7:53:44 PM: Enabling Node.js Corepack
7:53:44 PM: Started restoring cached build plugins
7:53:44 PM: Finished restoring cached build plugins
7:53:44 PM: Started restoring cached corepack dependencies
7:53:44 PM: Finished restoring cached corepack dependencies
7:53:44 PM: No pnpm workspaces detected
7:53:44 PM: Started restoring cached node modules
7:53:44 PM: Finished restoring cached node modules
7:53:45 PM: Installing npm packages using pnpm version 8.6.7
7:53:46 PM: Lockfile is up to date, resolution step is skipped
7:53:46 PM: Progress: resolved 1, reused 0, downloaded 0, added 0
7:53:46 PM: Packages: +1297
7:53:46 PM: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7:53:47 PM: Packages are hard linked from the content-addressable store to the virtual store.
7:53:47 PM:   Content-addressable store is at: /opt/build/.pnpm-store/v3
7:53:47 PM:   Virtual store is at:             node_modules/.pnpm
7:53:47 PM: Progress: resolved 1297, reused 0, downloaded 25, added 23
7:53:48 PM: Progress: resolved 1297, reused 0, downloaded 58, added 57
7:53:49 PM: Progress: resolved 1297, reused 0, downloaded 93, added 93
7:53:50 PM: Progress: resolved 1297, reused 0, downloaded 111, added 110
7:53:51 PM: Progress: resolved 1297, reused 0, downloaded 159, added 150
7:53:52 PM: Progress: resolved 1297, reused 0, downloaded 257, added 255
7:53:53 PM: Progress: resolved 1297, reused 0, downloaded 362, added 359
7:53:54 PM: Progress: resolved 1297, reused 0, downloaded 453, added 451
7:53:55 PM: Progress: resolved 1297, reused 0, downloaded 532, added 523
7:53:56 PM: Progress: resolved 1297, reused 0, downloaded 642, added 638
7:53:57 PM: Progress: resolved 1297, reused 0, downloaded 736, added 732
7:53:58 PM: Progress: resolved 1297, reused 0, downloaded 828, added 825
7:53:59 PM: Progress: resolved 1297, reused 0, downloaded 943, added 937
7:54:00 PM: Progress: resolved 1297, reused 0, downloaded 1041, added 1038
7:54:01 PM: Progress: resolved 1297, reused 0, downloaded 1110, added 1101
7:54:02 PM: Progress: resolved 1297, reused 0, downloaded 1208, added 1192
7:54:03 PM: Progress: resolved 1297, reused 0, downloaded 1281, added 1275
7:54:04 PM: Progress: resolved 1297, reused 0, downloaded 1296, added 1296
7:54:05 PM: Progress: resolved 1297, reused 0, downloaded 1297, added 1297, done
7:54:05 PM: .../fontawesome-common-types postinstall$ node attribution.js
7:54:05 PM: .../es5-ext@0.10.62/node_modules/es5-ext postinstall$  node -e "try{require("./_postinstall")}catch(e){}" || exit 0
7:54:05 PM: .../core-js@3.32.0/node_modules/core-js postinstall$ node -e "try{require("./postinstall")}catch(e){}"
7:54:05 PM: .../node_modules/core-js-pure postinstall$ node -e "try{require("./postinstall")}catch(e){}"
7:54:05 PM: .../fontawesome-common-types postinstall: Font Awesome Free 0.2.34 by @fontawesome - https://fontawesome.com
7:54:05 PM: .../fontawesome-common-types postinstall: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
7:54:05 PM: .../fontawesome-common-types postinstall: Done
7:54:05 PM: .../sharp@0.32.5/node_modules/sharp install$ (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
7:54:05 PM: .../core-js@3.32.0/node_modules/core-js postinstall: Done
7:54:05 PM: .../es5-ext@0.10.62/node_modules/es5-ext postinstall: Done
7:54:05 PM: .../node_modules/core-js-pure postinstall: Done
7:54:07 PM: .../sharp@0.32.5/node_modules/sharp install: sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.4/libvips-8.14.4-linux-x64.tar.br
7:54:07 PM: .../sharp@0.32.5/node_modules/sharp install: sharp: Integrity check passed for linux-x64
7:54:07 PM: .../sharp@0.32.5/node_modules/sharp install: Done
7:54:08 PM: .../@fortawesome/fontawesome-svg-core postinstall$ node attribution.js
7:54:08 PM: .../@fortawesome/free-brands-svg-icons postinstall$ node attribution.js
7:54:08 PM: .../node_modules/msgpackr-extract install$ node-gyp-build-optional-packages
7:54:08 PM: .../@fortawesome/fontawesome-svg-core postinstall: Font Awesome Free 1.2.34 by @fontawesome - https://fontawesome.com
7:54:08 PM: .../@fortawesome/fontawesome-svg-core postinstall: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
7:54:08 PM: .../@fortawesome/fontawesome-svg-core postinstall: Done
7:54:08 PM: .../@fortawesome/free-brands-svg-icons postinstall: Font Awesome Free 5.15.2 by @fontawesome - https://fontawesome.com
7:54:08 PM: .../@fortawesome/free-brands-svg-icons postinstall: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
7:54:08 PM: .../@fortawesome/free-brands-svg-icons postinstall: Done
7:54:08 PM: .../node_modules/msgpackr-extract install: Done
7:54:08 PM: .../.pnpm/lmdb@2.5.2/node_modules/lmdb install$ node-gyp-build-optional-packages
7:54:08 PM: .../.pnpm/lmdb@2.5.3/node_modules/lmdb install$ node-gyp-build-optional-packages
7:54:08 PM: .../.pnpm/lmdb@2.5.2/node_modules/lmdb install: Done
7:54:08 PM: .../.pnpm/lmdb@2.5.3/node_modules/lmdb install: Done
7:54:08 PM: .../node_modules/gatsby-telemetry postinstall$ node src/postinstall.js || true
7:54:08 PM: .../node_modules/gatsby-telemetry postinstall: Done
7:54:08 PM: .../node_modules/gatsby-cli postinstall$ node scripts/postinstall.js
7:54:08 PM: .../node_modules/gatsby-cli postinstall: Done
7:54:08 PM: .../node_modules/gatsby postinstall$ node scripts/postinstall.js
7:54:08 PM: .../node_modules/gatsby postinstall: Done
7:54:09 PM: dependencies:
7:54:09 PM: + @fortawesome/fontawesome-svg-core 1.2.34
7:54:09 PM: + @fortawesome/free-brands-svg-icons 5.15.2
7:54:09 PM: + @fortawesome/react-fontawesome 0.1.14
7:54:09 PM: + @testing-library/jest-dom 5.11.9
7:54:09 PM: + @testing-library/react 11.2.5
7:54:09 PM: + @testing-library/user-event 12.8.1
7:54:09 PM: + gatsby 5.11.0
7:54:09 PM: + gatsby-plugin-google-gtag 5.11.0
7:54:09 PM: + gatsby-plugin-image 3.11.0
7:54:09 PM: + gatsby-plugin-manifest 5.11.0
7:54:09 PM: + gatsby-plugin-sharp 5.11.0
7:54:09 PM: + gatsby-plugin-sitemap 6.11.0
7:54:09 PM: + gatsby-source-filesystem 5.11.0
7:54:09 PM: + gatsby-transformer-sharp 5.11.0
7:54:09 PM: + react 18.2.0
7:54:09 PM: + react-dom 18.2.0
7:54:09 PM: Done in 23.2s
7:54:09 PM: npm packages installed using pnpm
7:54:09 PM: Install dependencies script success
7:54:09 PM: Starting build script
7:54:10 PM: Detected 1 framework(s)
7:54:10 PM: "gatsby" at version "5.11.0"
7:54:10 PM: Section completed: initializing
7:54:12 PM: ​
7:54:12 PM: Netlify Build                                                 
7:54:12 PM: ────────────────────────────────────────────────────────────────
7:54:12 PM: ​
7:54:12 PM: ❯ Version
7:54:12 PM:   @netlify/build 29.21.1
7:54:12 PM: ​
7:54:12 PM: ❯ Flags
7:54:12 PM:   baseRelDir: true
7:54:12 PM:   buildId: 651c630e7ab09204734cbf7a
7:54:12 PM:   deployId: 651c630e7ab09204734cbf7c
7:54:12 PM: ​
7:54:12 PM: ❯ Current directory
7:54:12 PM:   /opt/build/repo
7:54:12 PM: ​
7:54:12 PM: ❯ Config file
7:54:12 PM:   No config file was defined: using default values.
7:54:12 PM: ​
7:54:12 PM: ❯ Context
7:54:12 PM:   production
7:54:12 PM: ​
7:54:12 PM: ❯ Installing plugins
7:54:12 PM:    - @netlify/plugin-lighthouse@5.0.0
7:54:24 PM: ​
7:54:24 PM: ❯ Loading plugins
7:54:24 PM:    - @netlify/plugin-lighthouse@5.0.0 from Netlify app
7:54:25 PM: ​
7:54:25 PM: Build command from Netlify app                                
7:54:25 PM: ────────────────────────────────────────────────────────────────
7:54:25 PM: ​
7:54:25 PM: $ pnpm clean && pnpm build
7:54:25 PM: > capability-charlotte-com@0.1.0 clean /opt/build/repo
7:54:25 PM: > gatsby clean
7:54:26 PM: info Deleting .cache, public, /opt/build/repo/node_modules/.cache/babel-loader, /opt/build/repo/node_modules/.cache/terser-webpack-plugin
7:54:26 PM: info Successfully deleted directories
7:54:27 PM: > capability-charlotte-com@0.1.0 build /opt/build/repo
7:54:27 PM: > gatsby build
7:54:29 PM: success compile gatsby files - 1.064s
7:54:29 PM: success load gatsby config - 0.027s
7:54:29 PM: success load plugins - 0.321s
7:54:29 PM: success onPreInit - 0.003s
7:54:29 PM: success initialize cache - 0.047s
7:54:30 PM: success copy gatsby files - 0.087s
7:54:30 PM: success Compiling Gatsby Functions - 0.166s
7:54:30 PM: success onPreBootstrap - 0.174s
7:54:30 PM: success createSchemaCustomization - 0.004s
7:54:32 PM: success Checking for changed pages - 0.000s
7:54:32 PM: success source and transform nodes - 2.276s
7:54:33 PM: info Writing GraphQL type definitions to /opt/build/repo/.cache/schema.gql
7:54:33 PM: success building schema - 1.000s
7:54:33 PM: success createPages - 0.004s
7:54:34 PM: success createPagesStatefully - 0.497s
7:54:34 PM: info Total nodes: 219, SitePage nodes: 13 (use --verbose for breakdown)
7:54:34 PM: success Checking for changed pages - 0.000s
7:54:34 PM: success onPreExtractQueries - 0.000s
7:54:45 PM: success extract queries from components - 10.911s
7:54:45 PM: success write out redirect data - 0.115s
7:54:46 PM: success Build manifest and related icons - 1.534s
7:54:46 PM: success onPostBootstrap - 1.538s
7:54:46 PM: info bootstrap finished - 19.672s
7:54:46 PM: success write out requires - 0.097s
7:54:56 PM: warning `isModuleDeclaration` has been deprecated, please migrate to `isImportOrExportDeclaration`
7:54:56 PM:     at isModuleDeclaration (/opt/build/repo/node_modules/.pnpm/@babel+types@7.22.10/node_modules/@babel/types/lib/validators/generated/index.js:2740:35)
7:54:56 PM:     at PluginPass.Program (/opt/build/repo/node_modules/.pnpm/babel-plugin-lodash@3.3.4/node_modules/babel-plugin-lodash/lib/index.js:102:44)
7:55:02 PM: failed Building production JavaScript and CSS bundles - 15.979s
7:55:02 PM: error Generating JavaScript bundles failed
7:55:02 PM: Can"t resolve "mitt" in "/opt/build/repo/.cache"
7:55:02 PM: If you"re trying to use a package make sure that "mitt" is installed. If you"re trying to use a local file make sure that the path is correct.
7:55:02 PM: error Generating JavaScript bundles failed
7:55:02 PM: Can"t resolve "shallow-compare" in "/opt/build/repo/.cache"
7:55:02 PM: If you"re trying to use a package make sure that "shallow-compare" is installed. If you"re trying to use a local file make sure that the path is correct.
7:55:02 PM: error Generating JavaScript bundles failed
7:55:02 PM: Can"t resolve "@gatsbyjs/reach-router" in "/opt/build/repo/.cache"
7:55:02 PM: If you"re trying to use a package make sure that "@gatsbyjs/reach-router" is installed. If you"re trying to use a local file make sure that the path is correct.
7:55:02 PM: error Generating JavaScript bundles failed
7:55:02 PM: Can"t resolve "gatsby-react-router-scroll" in "/opt/build/repo/.cache"
7:55:02 PM: If you"re trying to use a package make sure that "gatsby-react-router-scroll" is installed. If you"re trying to use a local file make sure that the path is correct.
7:55:02 PM: error Generating JavaScript bundles failed
7:55:02 PM: Can"t resolve "gatsby-link" in "/opt/build/repo/.cache"
7:55:02 PM: If you"re trying to use a package make sure that "gatsby-link" is installed. If you"re trying to use a local file make sure that the path is correct.
7:55:02 PM: error Generating JavaScript bundles failed
7:55:02 PM: Can"t resolve "gatsby-script" in "/opt/build/repo/.cache"
7:55:02 PM: If you"re trying to use a package make sure that "gatsby-script" is installed. If you"re trying to use a local file make sure that the path is correct.
7:55:02 PM: error Generating JavaScript bundles failed
7:55:02 PM: Can"t resolve "@gatsbyjs/reach-router" in "/opt/build/repo/.cache/head"
7:55:02 PM: If you"re trying to use a package make sure that "@gatsbyjs/reach-router" is installed. If you"re trying to use a local file make sure that the path is correct.
7:55:02 PM: error Generating JavaScript bundles failed
7:55:02 PM: Can"t resolve "@gatsbyjs/reach-router" in "/opt/build/repo/.cache"
7:55:02 PM: If you"re trying to use a package make sure that "@gatsbyjs/reach-router" is installed. If you"re trying to use a local file make sure that the path is correct.
7:55:02 PM: error Generating JavaScript bundles failed
7:55:02 PM: Can"t resolve "gatsby-link" in "/opt/build/repo/.cache"
7:55:02 PM: If you"re trying to use a package make sure that "gatsby-link" is installed. If you"re trying to use a local file make sure that the path is correct.
7:55:02 PM: error Generating JavaScript bundles failed
7:55:02 PM: Can"t resolve "prop-types" in "/opt/build/repo/.cache"
7:55:02 PM: If you"re trying to use a package make sure that "prop-types" is installed. If you"re trying to use a local file make sure that the path is correct.
7:55:02 PM: error Generating JavaScript bundles failed
7:55:02 PM: Can"t resolve "@gatsbyjs/reach-router" in "/opt/build/repo/.cache"
7:55:02 PM: If you"re trying to use a package make sure that "@gatsbyjs/reach-router" is installed. If you"re trying to use a local file make sure that the path is correct.
7:55:02 PM: error Generating JavaScript bundles failed
7:55:02 PM: Can"t resolve "gatsby-react-router-scroll" in "/opt/build/repo/.cache"
7:55:02 PM: If you"re trying to use a package make sure that "gatsby-react-router-scroll" is installed. If you"re trying to use a local file make sure that the path is correct.
7:55:02 PM: not finished Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 22.878s
7:55:03 PM:  ELIFECYCLE  Command failed with exit code 1. (https://ntl.fyi/exit-code-1)
7:55:04 PM: ​
7:55:04 PM: "build.command" failed                                        
7:55:04 PM: ────────────────────────────────────────────────────────────────
7:55:04 PM: ​
7:55:04 PM:   Error message
7:55:04 PM:   Command failed with exit code 1: pnpm clean && pnpm build (https://ntl.fyi/exit-code-1)
7:55:04 PM: ​
7:55:04 PM:   Error location
7:55:04 PM:   In Build command from Netlify app:
7:55:04 PM:   pnpm clean && pnpm build
7:55:04 PM: ​
7:55:04 PM:   Resolved config
7:55:04 PM:   build:
7:55:04 PM:     command: pnpm clean && pnpm build
7:55:04 PM:     commandOrigin: ui
7:55:04 PM:     publish: /opt/build/repo/public
7:55:04 PM:     publishOrigin: ui
7:55:04 PM:   plugins:
7:55:04 PM:     - inputs: {}
7:55:04 PM:       origin: ui
7:55:04 PM:       package: "@netlify/plugin-lighthouse"
7:55:05 PM: Caching artifacts
7:55:05 PM: Started saving node modules
7:55:05 PM: Finished saving node modules
7:55:05 PM: Started saving build plugins
7:55:05 PM: Finished saving build plugins
7:55:05 PM: Started saving corepack cache
7:55:05 PM: Finished saving corepack cache
7:55:05 PM: Started saving pip cache
7:55:05 PM: Finished saving pip cache
7:55:05 PM: Started saving emacs cask dependencies
7:55:05 PM: Finished saving emacs cask dependencies
7:55:05 PM: Started saving maven dependencies
7:55:05 PM: Finished saving maven dependencies
7:55:05 PM: Started saving boot dependencies
7:55:05 PM: Finished saving boot dependencies
7:55:05 PM: Started saving rust rustup cache
7:55:05 PM: Finished saving rust rustup cache
7:55:05 PM: Started saving go dependencies
7:55:05 PM: Finished saving go dependencies
7:55:06 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
7:55:06 PM: Cached Ruby version 2.7.1
7:55:06 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:55:06 PM: Failing build: Failed to build site
7:55:06 PM: Finished processing build request in 1m50.505s

I assume this is something to do with the fact that this site used to be built with different settings but “Clear Cache and Deploy Site” also fails in the same way. Creating a brand new site in Netlify with the same code works however (see https://deluxe-donut-427c03.netlify.app/), so this isn’t an issue with my code.

Hi @MorayM,

Thanks for reaching out and welcome to Netlify’s Support Forums!

Looking at the latest deploy that failed, I’m seeing these errors:

1:55:02 PM: failed Building production JavaScript and CSS bundles - 15.979s

1:55:02 PM: error Generating JavaScript bundles failed

1:55:02 PM: Can"t resolve "mitt" in "/opt/build/repo/.cache"

1:55:02 PM: If you"re trying to use a package make sure that "mitt" is installed. If you"re trying to use a local file make sure that the path is correct.

1:55:02 PM: error Generating JavaScript bundles failed

1:55:02 PM: Can"t resolve "shallow-compare" in "/opt/build/repo/.cache"

1:55:02 PM: If you"re trying to use a package make sure that "shallow-compare" is installed. If you"re trying to use a local file make sure that the path is correct.

1:55:02 PM: error Generating JavaScript bundles failed

1:55:02 PM: Can"t resolve "@gatsbyjs/reach-router" in "/opt/build/repo/.cache"

1:55:02 PM: If you"re trying to use a package make sure that "@gatsbyjs/reach-router" is installed. If you"re trying to use a local file make sure that the path is correct.

1:55:02 PM: error Generating JavaScript bundles failed

1:55:02 PM: Can"t resolve "gatsby-react-router-scroll" in "/opt/build/repo/.cache"

1:55:02 PM: If you"re trying to use a package make sure that "gatsby-react-router-scroll" is installed. If you"re trying to use a local file make sure that the path is correct.

1:55:02 PM: error Generating JavaScript bundles failed

1:55:02 PM: Can"t resolve "gatsby-link" in "/opt/build/repo/.cache"

1:55:02 PM: If you"re trying to use a package make sure that "gatsby-link" is installed. If you"re trying to use a local file make sure that the path is correct.

1:55:02 PM: error Generating JavaScript bundles failed

1:55:02 PM: Can"t resolve "gatsby-script" in "/opt/build/repo/.cache"

1:55:02 PM: If you"re trying to use a package make sure that "gatsby-script" is installed. If you"re trying to use a local file make sure that the path is correct.

1:55:02 PM: error Generating JavaScript bundles failed

1:55:02 PM: Can"t resolve "@gatsbyjs/reach-router" in "/opt/build/repo/.cache/head"

1:55:02 PM: If you"re trying to use a package make sure that "@gatsbyjs/reach-router" is installed. If you"re trying to use a local file make sure that the path is correct.

1:55:02 PM: error Generating JavaScript bundles failed

1:55:02 PM: Can"t resolve "@gatsbyjs/reach-router" in "/opt/build/repo/.cache"

1:55:02 PM: If you"re trying to use a package make sure that "@gatsbyjs/reach-router" is installed. If you"re trying to use a local file make sure that the path is correct.

1:55:02 PM: error Generating JavaScript bundles failed

1:55:02 PM: Can"t resolve "gatsby-link" in "/opt/build/repo/.cache"

1:55:02 PM: If you"re trying to use a package make sure that "gatsby-link" is installed. If you"re trying to use a local file make sure that the path is correct.

1:55:02 PM: error Generating JavaScript bundles failed

1:55:02 PM: Can"t resolve "prop-types" in "/opt/build/repo/.cache"

1:55:02 PM: If you"re trying to use a package make sure that "prop-types" is installed. If you"re trying to use a local file make sure that the path is correct.

1:55:02 PM: error Generating JavaScript bundles failed

1:55:02 PM: Can"t resolve "@gatsbyjs/reach-router" in "/opt/build/repo/.cache"

1:55:02 PM: If you"re trying to use a package make sure that "@gatsbyjs/reach-router" is installed. If you"re trying to use a local file make sure that the path is correct.

1:55:02 PM: error Generating JavaScript bundles failed

1:55:02 PM: Can"t resolve "gatsby-react-router-scroll" in "/opt/build/repo/.cache"

1:55:02 PM: If you"re trying to use a package make sure that "gatsby-react-router-scroll" is installed. If you"re trying to use a local file make sure that the path is correct.

I found this forum post with a similar issue:

Are you able to follow the solution to see if it resolve your issue?

OK, I’ve cleared and regenerated my pnpm-lock.yaml but am still getting the same error. If all else fails I can still deploy it to a clean project, I’ll just have to port over all the configuration and DNS.

@MorayM,

It appears you’ve got some successful builds lately. Have you managed to resolve this?