gatsby-source-prismic-graphql
gatsby-source-prismic-graphql copied to clipboard
Uncaught TypeError: Cannot set property 'query' of undefined
Console throws an error when I build my project and run gatsby serve.
Uncaught TypeError: Cannot set property 'query' of undefined
Neither swiper carousel nor bootstrap navbar toggle is working in production. In development mode everything works great!
Here's a github link to reproduction of my project https://github.com/Teo0303/raisense-bug-repro/
Here's my website that has the issue. https://raisense.uz/
Can anybody ever solved this kind of problem?
*** Edit ***
This problem only appears when I use gatsby-source-prismic-graphql. When I loaded data from local storage and built my project, problem disappeared
With beta2 that is gone. But be aware that some other issues may come see https://github.com/birkir/gatsby-source-prismic-graphql/issues/77
@saschb2b looks like even with the beta, it's breaking other usestaticquerys when you build it. Works find locally.
Yep. Had to refactor everything to use the StaticQuery component
Hey, @Teo0303 I don't see any problem when Itry to use your project. I don't understand why you're having this error in gatsby-browser.js though.
Are you performing queries in gatsby-browser?
Having the same issue 👋
I also am having this issue, you can work around by commenting out the fix and using a forked version of the repo. Not ideal though @birkir would you accept a PR for the removal of the fix?
EDIT
Anyone wanting a workaround this has worked fine for me till we have a permanent solution: make a copy of the gatsby-browser.js
file from gatsby-source-prismic-graphql with the previous fix code commented out / deleted. Add this to your package.json
scripts:
"postinstall": "mv PATCHED_GATSBY_BROWSER.js node_modules/gatsby-source-prismic-graphql/gatsby-browser.js && echo '** gatsby-source-prismic-graphql has been patched, only confirmed as working on v3.3.1 test before upgrading **'"
Hi, I see a v3.4.0
tag in your repo, but it's not published to npm. Does that version include the fix for this? I'm not able to install it directly from github bc. of something to do w/ your package.json
setup.
I had the same issue. Building the project for production is causing all JS events like onClick to stop working. I've manage to work around it my using version: 3.4.0-beta.1 and then switching all my useStaticQuery to < StaticQuery />. Hoping for an update soon :)
Running into this issue with useStaticQuery also. Using this plugin is quite the frustrating experience.
I had the same problem. With version gatsby-source-prismic-graphql": { "version": "3.5.0" it works.
I have the same issue. Unfortunately 3.5.0
doesn't fix it on my end. Changing to <StaticQuery />
was the only working quick workaround.
@birkir can we have your assistance on this issue?
Same issue here. With the latest version of the plugin. (3.5.0)
<StaticQuery /> indeed works as a temporary&ugly fix. Thanks!