-
Notifications
You must be signed in to change notification settings - Fork 75
Cannot find module './third-party/gatsby-node' #217
Comments
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:
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: birkir/gatsby-source-graphql-universal@f349162 |
So I managed to work around it for now by using the following in my package.json
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", 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.
|
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: DescriptionFollowing setup instructions from various sources (e.g. here), 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 reproducenpx 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 resultStart local dev server without error. Actual resultError 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: 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.
|
@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 Steps:
This won't work for production, of course. This is the commit that broke the setup. The reason is that the new 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? |
Thanks! This worked for me after I cleared my EDIT: |
Same issue... |
Resolutions can be added in NPM similar to Yarn using this package -> https://github.com/rogeriochaves/npm-force-resolutions
|
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. |
The same issue :( System: |
I just made my website dynamic and the only issue I had is solved by the comment from @chrisworman-pela in issue #196. Id recommend to take either my versions and workaround as approach or supply is with a minimal viable product that reproduces your error. Everything is golden for me and I am willing to dive into what ever is going wrong at your guys side. Edit: |
I am having this same problem running the prismic.io tutorial STEP-BY-STEP from their website. So I'm using a fresh installation on a dummy/starter project (Installing cleanly from the tutorial setup instructions at https://prismic.io/docs/gatsby/getting-started-tutorials/launching-the-project), receiving the same error. I would list all the details of my environment, but I doubt I have a configuration too much different from those listed above. I tried different versions of "gatsby-source-graphql-universal", "gatsby-source-prismic-graphql", and "gatsby". None of the solutions in this thread worked for me. Original issue was posted 29 days ago, so I guess I'm not learning/using prismic.. which sucks because it looks great. |
I'm with @raleigh9123 on this. Just exploring prismic as solution to our platfrom but if this basic problem isn't resolved since 29 days I don't think it gives us much confidence to the product and support. |
@amitava82 The main thing is, the plugin isn't first party, it's an amazing plugin when it works, but understandably people in open source. I feel a bit sorry for the author of this plugin that prismic have co-opted it like they have. |
Yeah sorry I didn't realize it isn't first party plugin. When I saw this on prismic documentation I assumed so. Seems like prismic trying to piggyback on a 3rd party plugin without supporting original author. |
I am working on a working MVP which will soon contain the code you need. I did notice my previews started to break while my production app is working as a charm. I am guessing an dependency updated. Edit 1: Edit 2: my redeploy of my linux preview works as a charm still. Now gonna try remove every type of cache and run the project locally on my macbook. Edit 3: Edit 4: Edit 5: Edit 6: |
It works 🥳I created a working project that runs previews like a charm on Unix machines. The issue I didn't face but others did is sourced from a dependency that updated somewhere. After I added my working yarn.lock deps to the example project the You can find the project here: https://github.com/Bram-Zijp/gatsby-prismic-graphql-working-example Edit 1: Edit 2: Edit 3: Edit 5: DISCLAIMER
Quick fix hack 🙈Copy my yarn.lock file from the example project over yours and do a yarn install. It should start to work magically in most cases. |
Any updates on an official fix for it? |
The workaround that's working for me for production environment is it to copy the content of the gatsby-node.js from gatsby-source-graphql-universal from a project which was working before this problem cropped up. Then you paste this content into the gatsby-node.js of the project that errors out. I imagine the issue lies in how gatsby-source-prismic-graphql is installing its peer dependencies. |
I've found that swapping the first require within 'gatsby-source-graphql-universal/gatsby-node.js' works for me |
HI, |
@MarcMcIntosh I can't seem to get a build to run with that plugin ^ When i add this package: and the plugin to my gatsby-config: I get: "@prismicio/gatsby-source-prismic-graphql" threw an error while running the sourceNodes lifecycle: executor is not a function 83 |
File: node_modules/@prismicio/gatsby-source-graphql-universal/third-party/gatsby-node.js:85:37 |
Alright I look into that |
That new fork did the trick! Thanks |
@MarcMcIntosh the new fork seems to be giving back the issue with images as it was on issue #196 |
When upgrading from 3.6.3-alpha.12 -> 3.6.3-alpha.13 this issue comes up. |
Regarding @steoneill's comment, just wanted to note that the issue was posted in the prismic repo, along with a revised workaround (thanks to @TimFletcher): |
@steoneill Should be fixed on the fork :) |
@MarcMcIntosh, thanks for all work you have been doing. Maybe someone can open and pin an issue telling that prismic team has created a fork of this plugin that has solved some issues already? I spent many time and had to dig to find out about it. I also think Maybe prismic could update their website where they mention that the preview feature works with gatsby. The feature has some limitations and issues as reported here in the repo. So I would not consider that is 100% ready for production, specially for the preview feature. This is leading many users to believe that unlimited preview feature is actually working with gatsby. Thinking like a developer I know that birkir and all the contributors have done a great job in developing this plugin for the community, but thinking like a user, I am a bit frustrated because I read on prismic website and watched an youtube video where prismic says that preview feature is working with gatsby, and that's why I made the decision to develop new projects using prismic. (I was using contentful + gatsby cloud before, where preview feature works really well). I believe other users like me that develop websites using gatsby choose prismic because of it. Since prismic team adverts this plugin on your website saying that it works with gatsby, maybe prismic team could warn users about that limitation and current bugs? Really appreciate all the work you have been doing, but I just developed a brand new website for a client and now really disappointing to tell my client that the preview feature doesn't work. If I knew that before maybe I could make a better decision instead of spending many hours ($$) troubleshooting issues with this plugin/preview feature. We have issues like #45 that are a year old and still unresolved. What if we start by addressing all current issues and creating a community chat on discord or something else where we can organize and plan how to solve all these issues? Please let me know if you need any help with this, I could help to organize/address all issues and also to put my hands into code to fix that. Thanks again for all work you have been doing. Cheers |
@lucashfreitas I think the best you/we can do is to create reproducible issues on the prismic fork |
For NPM newbies like me that need more specific instructions (I just posted this in a different issue but the fork also fixes this problem): The easiest way I found to seamlessly switch to the prismic fork mentioned by @MarcMcIntosh was to first remove the old package (and any version of gatsby-source-graphql-universal), and then install the prismic version as an alias.
Can also be done by adding this to your package.json dependencies
This should as far as I know work for any project without having to copy an old version of node modules or do other unfortunate dependency resolutions. I think it should work for production but haven't verified that yet. |
Hello! It's the start of August and I wanted to highlight this reply from earlier in the thread for those just getting the issue now -- I can confirm this fix still works. Fix: #217 (comment) I have not yet tried what @natedonato has mentioned above as I found this fix reading chronologically and needed any fix to continue dev work. I will test it out later on considering it's a fork directly from Prismic. Thank you @iamsainikhil! |
Has it been confirmed whether or not the fix from comment 217 works in production? |
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
The text was updated successfully, but these errors were encountered: