gatsby-source-prismic-graphql
gatsby-source-prismic-graphql copied to clipboard
Cannot find module './third-party/gatsby-node'
Getting an error on build;
Error in "C:...\node_modules\gatsby-source-prismic-graphql\gatsby-node.js": Cannot find module './third-party/gatsby-node'
Any ideas?
Thanks
Joe
I've been getting the same since yesterday and is been blocking a project from going live!
Nightmare @joeweale !!!
Any thought will be great!
Thanks
I have the same issue
Potentially falling back to "gatsby-source-graphql-universal": "3.3.0" could fix the issue. I've tried it on a new project and it work. I'm now applying it on my project. Fingers crossed!
@aodysseos I tried gatsby-source-prismic-graphql 3.6.2, 3.5.0, 3.3.0 and I still get the same error.
edit:// I am not using gatsby-source-graphql-universal, only gatsby-source-prismic-graphql
@AndrejGajdos I have:
- "gatsby": "^2.21.37",
- "gatsby-source-prismic-graphql": "^3.6.2",
- "gatsby-source-graphql-universal": "3.3.0"
and running node v10.13.0
If that helps
@aodysseos thanks I checked my package.json and I don't use gatsby-source-graphql-universal. I use only gatsby-source-prismic-graphql. I tried gatsby-source-prismic-graphql three different versions 3.6.2, 3.5.0, 3.3.0 and it didn't help.
I tried to add "gatsby-source-graphql-universal": "3.3.0" dependency and it didn't solve the issue.
Do you mean changing gatsby-source-graphql-universal inside gatsby-source-prismic-graphql?
Same problem here...
Yep this seem to have started happening this morning
Seems related to this commit: https://github.com/birkir/gatsby-source-graphql-universal/commit/f3491620523b800dccdf790872eedcfd6dc79555
So I managed to work around it for now by using the following in my package.json
- "gatsby": "^2.21.37",
- "gatsby-source-graphql-universal": "3.3.0",
- "gatsby-source-prismic-graphql": "3.4.0-beta.1"
It seems that gatsby-source-prismic-graphql installs the latest version of gatsby-source-graphql-universal as a dependancy which has the issue. By forcing a specific version and using a previous version of gatsby-source-prismic-graphql I got around the problem for now and got my project to build.
NOTE: gatsby-source-graphql-universal was updated 20hrs ago so I'm guessing that caused it.
Hope that helps
@aodysseos The exact same configuration didn't fix it for me.
I've got it working by installing: "gatsby-source-graphql-universal": "3.3.0", and removing "gatsby-source-graphql-universal" from node_modules/gatsby-source-prismic/node_modules.
It still installs 3.4.0 in there
I got it working by deleting node_modules, adding a yarn dependency resolution to my package.json, and reinstalling with yarn. Hopefully this issue gets fixed soon.
"resolutions": { "gatsby-source-graphql-universal": "3.3.0" },
Same issue!
Edit: locking the dependency using a resolutions block as per zpthree's suggestion is the correct workaround.
Same issue using Windows 10, unfortunately I don't use Yarn so the resolution workaround isn't available to me.
Filed an issue with Gatsby before finding out this package wasn't maintained by them. Here's my report with a few extra details and an example site:
Description
Following setup instructions from various sources (e.g. here), gatsby-source-prismic-graphql
throws the following error:
Error: Cannot find module './third-party/gatsby-node'
Require stack:
- /Users/mrseanbaines/projects/gatsby-prismic-blog/node_modules/gatsby-source-graphql-universal/gatsby-node.js
- /Users/mrseanbaines/projects/gatsby-prismic-blog/node_modules/gatsby-source-prismic-graphql/gatsby-node.js
- /Users/mrseanbaines/projects/gatsby-prismic-blog/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
- /Users/mrseanbaines/projects/gatsby-prismic-blog/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
- /Users/mrseanbaines/projects/gatsby-prismic-blog/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
- /Users/mrseanbaines/projects/gatsby-prismic-blog/node_modules/gatsby/dist/bootstrap/load-plugins/index.js
- /Users/mrseanbaines/projects/gatsby-prismic-blog/node_modules/gatsby/dist/bootstrap/index.js
- /Users/mrseanbaines/projects/gatsby-prismic-blog/node_modules/gatsby/dist/commands/develop.js
- /Users/mrseanbaines/projects/gatsby-prismic-blog/node_modules/gatsby-cli/lib/create-cli.js
- /Users/mrseanbaines/projects/gatsby-prismic-blog/node_modules/gatsby-cli/lib/index.js
- /Users/mrseanbaines/projects/gatsby-prismic-blog/node_modules/gatsby/dist/bin/gatsby.js
Steps to reproduce
npx gatsby new gatsby-prismic-blog
cd gatsby-prismic-blog
yarn add gatsby-source-prismic-graphql prismic-javascript prismic-reactjs
yarn start
Minimal Reproduction: https://github.com/mrseanbaines/gatsby-prismic-blog
Expected result
Start local dev server without error.
Actual result
Error throws when starting local dev server.
Environment
System:
OS: macOS 10.15.4
CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.16.1 - /usr/local/bin/node
Yarn: 1.22.4 - ~/.yarn/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 83.0.4103.61
Firefox: 76.0.1
Safari: 13.1
npmPackages:
gatsby: ^2.21.37 => 2.21.37
gatsby-image: ^2.4.4 => 2.4.4
gatsby-plugin-manifest: ^2.4.5 => 2.4.5
gatsby-plugin-offline: ^3.2.3 => 3.2.3
gatsby-plugin-react-helmet: ^3.3.1 => 3.3.1
gatsby-plugin-sharp: ^2.6.4 => 2.6.4
gatsby-source-filesystem: ^2.3.4 => 2.3.4
gatsby-source-prismic-graphql: ^3.6.2 => 3.6.2
gatsby-transformer-sharp: ^2.5.2 => 2.5.2
I ran into the same issue when updating my packages and solved it by reverting back to the following versions: "gatsby": "^2.20.19", "gatsby-plugin-sharp": "^2.5.4", "gatsby-source-filesystem": "^2.2.2", "gatsby-source-prismic-graphql": "^3.6.2", "gatsby-transformer-sharp": "^2.4.4",
All of these may not be required but I didn't have any more time to spend on it.
running into the exact same issue here.
gatsby info
System:
OS: macOS 10.15.4
CPU: (8) x64 Intel(R) Core(TM) i7-1060NG7 CPU @ 1.20GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.0.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Firefox: 76.0.1
Safari: 13.1
npmPackages:
gatsby: ^2.22.12 => 2.22.12
gatsby-image: ^2.4.4 => 2.4.5
gatsby-plugin-manifest: ^2.4.5 => 2.4.5
gatsby-plugin-offline: ^3.2.3 => 3.2.3
gatsby-plugin-react-helmet: ^3.3.1 => 3.3.1
gatsby-plugin-sharp: ^2.6.4 => 2.6.4
gatsby-source-filesystem: ^2.3.4 => 2.3.8
gatsby-source-prismic-graphql: ^3.6.2 => 3.6.2
gatsby-transformer-sharp: ^2.5.2 => 2.5.2
npmGlobalPackages:
gatsby-cli: 2.12.37
@zpthree Thanks for the fix, I didn't know yarn has such a nice feature.
Just adding more information why this issue cropped up.
I hacked my way through this issue by force-creating the gatsby-node.js
in the right folder, and it works for development.
Steps:
- Locate
gatsby-source-graphql-universal
in yournode_modules
- Create a folder called
third-party
in the folder - Copy this
gatsby-node.js
file into the folder
This won't work for production, of course. This is the commit that broke the setup. The reason is that the new third-party
folder was not included in packaging.
I just created a new issue on that repo.
Same problem here 😥
I'm getting the same problem, hopefully this issue can get resolved 🙏🏽
Reverting is working for me locally but still breaks for me during deploys to production. Anyone else running into that?
@aodysseos
So I managed to work around it for now by using the following in my package.json
- "gatsby": "^2.21.37",
- "gatsby-source-graphql-universal": "3.3.0",
- "gatsby-source-prismic-graphql": "3.4.0-beta.1"
It seems that gatsby-source-prismic-graphql installs the latest version of gatsby-source-graphql-universal as a dependancy which has the issue. By forcing a specific version and using a previous version of gatsby-source-prismic-graphql I got around the problem for now and got my project to build.
NOTE: gatsby-source-graphql-universal was updated 20hrs ago so I'm guessing that caused it.
Hope that helps
Thanks! This worked for me after I cleared my ./node_modules/
EDIT: Nevermind, build fails in prod/staging
Same issue...
Resolutions can be added in NPM similar to Yarn using this package -> https://github.com/rogeriochaves/npm-force-resolutions
- Add the below
preinstall
script inpackage.json
"scripts": {
"preinstall": "npx npm-force-resolutions"
}
- Add the
gatsby-source-graphql-universal
inresolutions
"resolutions": {
"gatsby-source-graphql-universal": "3.3.0"
}
- Run the
npm install
Yup, same issue here. Hopefully it gets fixed soon.
The one day I find some time to muck around with prismic this happens, of course.
would i be fine just using gatsby-source-prismic instead of this plugin? Am i losing any major benefits going that route?