gatsby icon indicating copy to clipboard operation
gatsby copied to clipboard

GraphiQL White Screen of Death on Gatsby V5.11.0

Open hasanshafiq29 opened this issue 1 year ago • 36 comments

Preliminary Checks

  • [X] This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
  • [X] This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions

Description

Error: Tooltip must be used within TooltipProvider

I am getting this error

Just open graphiQL and it loads for a second and then white screen

Reproduction Link

https://github.com/ample/gatsby-minimal-reproduction-38634/tree/main

Steps to Reproduce

Just open graphiQL and it loads for a second and then white screen

Expected Result

GraphiQL IDE should work

Actual Result

Page crashin

Environment

System:
    OS: macOS 13.5.2
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.5.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.8.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 117.0.5938.149
    Safari: 16.6
  npmPackages:
    gatsby: 5.11.0 => 5.11.0 
    gatsby-plugin-algolia-search: ^0.5.6 => 0.5.7 
    gatsby-plugin-google-tagmanager: ^5.12.1 => 5.12.1 
    gatsby-plugin-loadable-components-ssr: ^4.3.2 => 4.3.2 
    gatsby-plugin-manifest: ^5.12.1 => 5.12.1 
    gatsby-plugin-netlify: 5.1.1 => 5.1.1 
    gatsby-plugin-perf-budgets: ^0.0.18 => 0.0.18 
    gatsby-plugin-postcss: ^5.21.0 => 5.25.0 
    gatsby-plugin-preconnect: ^1.4.0 => 1.4.0 
    gatsby-plugin-react-helmet: ^6.12.0 => 6.12.0 
    gatsby-plugin-remove-console: ^0.0.2 => 0.0.2 
    gatsby-plugin-resolve-src: ^2.0.0 => 2.1.0 
    gatsby-plugin-sass: ^6.12.1 => 6.12.1 
    gatsby-plugin-sitemap: ^6.12.1 => 6.12.1 
    gatsby-plugin-webpack-bundle-analyser-v2: ^1.1.27 => 1.1.31 
    gatsby-source-contentstack: ^5.1.0 => 5.1.0 
    gatsby-source-remote-csv: ^1.0.1 => 1.0.1

Config Flags

flags: { DEV_SSR: false, PRESERVE_FILE_DOWNLOAD_CACHE: true, PARALLEL_SOURCING: true },

hasanshafiq29 avatar Oct 13 '23 01:10 hasanshafiq29

We're having the exact same problem! Thank you for opening this issue. In our case, we notice it doesn't happen with one of our repositories that still uses Gatsby v5.11.0. It does, however, happen on a different one using v.5.12.6 (and when I tested a feature branch updating the 5.11 repo to 5.12.6, it generated the white screen of death too).

So...something apparently happened between Gatsby v5.11.0 and v5.12.? to cause this.

tqureshi-uog avatar Oct 13 '23 18:10 tqureshi-uog

@tqureshi-uog Maybe you haven't updated the dependencies on the project which is using Gatsby 5.11.0. I have tried updating the dependencies and still issue persist. Also I don't want to upgrade to Gatsby to 5.12.6 as its having issue with gatsby-netlify-plugin and adapters.

hasanshafiq29 avatar Oct 13 '23 18:10 hasanshafiq29

To clarify, we're not seeing the problem with Gatsby v5.11 - we are seeing the problem with the newer version, 5.12.6

Now that I look at your environment info, however, I see you're having the problem even though you're on v5.11. I'll take another look at our setup for the repo where GraphiQL is working.

tqureshi-uog avatar Oct 13 '23 18:10 tqureshi-uog

You may see if you clean install your dependencies again. or If not, I maybe having a dependency updated for 5.12.6 because I upgraded to 5.12.6 and then went back to 5.11.0

hasanshafiq29 avatar Oct 13 '23 19:10 hasanshafiq29

Here's my information for the repository where GraphiQL works:

  System:
    OS: Linux 4.4 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
    npm: 10.2.0 - ~/.nvm/versions/node/v18.17.1/bin/npm
  npmPackages:
    gatsby: ^5.11.0 => 5.11.0
    gatsby-plugin-image: ^3.11.0 => 3.11.0
    gatsby-plugin-manifest: ^5.11.0 => 5.11.0
    gatsby-plugin-mdx: ^5.11.0 => 5.11.0
    gatsby-plugin-react-helmet: ^6.11.0 => 6.11.0
    gatsby-plugin-sass: ^6.11.0 => 6.11.0
    gatsby-plugin-sharp: ^5.11.0 => 5.11.0
    gatsby-plugin-styled-components: ^6.11.0 => 6.11.0
    gatsby-source-drupal: ^6.11.0 => 6.11.0
    gatsby-source-filesystem: ^5.11.0 => 5.11.0
    gatsby-source-wordpress: ^7.11.0 => 7.11.0
    gatsby-transformer-sharp: ^5.11.0 => 5.11.0
    gatsby-transformer-yaml: ^5.11.0 => 5.11.0
  npmGlobalPackages:
    gatsby-cli: 5.12.1

Here's the info for the repo where GraphiQL does not work and gives the White Screen of Death:

  System:
    OS: Linux 4.4 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
    npm: 10.2.0 - ~/.nvm/versions/node/v18.17.1/bin/npm
  npmPackages:
    gatsby: ^5.12.6 => 5.12.6
    gatsby-cli: ^5.12.2 => 5.12.2
    gatsby-plugin-asset-path: ^3.0.4 => 3.0.4
    gatsby-plugin-client-side-redirect: ^1.1.0 => 1.1.0
    gatsby-plugin-gatsby-cloud: ^5.12.1 => 5.12.1
    gatsby-plugin-google-analytics: ^5.12.0 => 5.12.0
    gatsby-plugin-google-tagmanager: ^5.12.1 => 5.12.1
    gatsby-plugin-image: ^3.12.1 => 3.12.1
    gatsby-plugin-manifest: ^5.12.1 => 5.12.1
    gatsby-plugin-react-helmet: ^6.12.0 => 6.12.0
    gatsby-plugin-robots-txt: ^1.8.0 => 1.8.0
    gatsby-plugin-root-import: ^2.0.9 => 2.0.9
    gatsby-plugin-sharp: ^5.12.1 => 5.12.1
    gatsby-plugin-styled-components: ^6.12.0 => 6.12.0
    gatsby-source-drupal: ^6.12.1 => 6.12.1
    gatsby-source-filesystem: ^5.12.0 => 5.12.0
    gatsby-source-wordpress: ^7.12.1 => 7.12.1
    gatsby-transformer-sharp: ^5.12.1 => 5.12.1
    gatsby-transformer-yaml: ^5.12.0 => 5.12.0
  npmGlobalPackages:
    gatsby-cli: 5.12.1

Again, the only relevant difference I can see is that my working repo is on v5.11.0 while the one that used to work but now doesn't is on 5.12.6

For what it's worth, here's the changelog for gatsby-graphiql-explorer: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-graphiql-explorer/CHANGELOG.md

Though this might all be a red herring and there's something else causing the problem.

tqureshi-uog avatar Oct 13 '23 19:10 tqureshi-uog

I am experiencing this behavior when exporting ENABLE_GATSBY_REFRESH_ENDPOINT=true. When this value is set to false GraphiQL loads like normal.

Minimal reproduction using v5.12.6 is here.

  System:
    OS: macOS 12.6.3
    CPU: (16) x64 Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.17.0 - ~/.nvm/versions/node/v18.17.0/bin/node
    npm: 9.6.7 - ~/.nvm/versions/node/v18.17.0/bin/npm
  npmPackages:
    gatsby: ^5.12.4 => 5.12.6 

tcmacdonald avatar Oct 16 '23 19:10 tcmacdonald

I can confirm the same behavior as @tcmacdonald. We're on v5.12.5, and changing ENABLE_GATSBY_REFRESH_ENDPOINT to false fixes the issue.

ccesare avatar Oct 17 '23 18:10 ccesare

I have tried setting ENABLE_GATSBY_REFRESH_ENDPOINT to false on Gatsby v5.11.0. But still the issue persist.

hasanshafiq29 avatar Oct 17 '23 19:10 hasanshafiq29

I believe I might have found a more consistent solution - upgrade GraphQL to v16.8.1 as per https://github.com/graphql/graphql-js/releases

We were alerted about this update after activating dependabot on our repository. Once we merged the GraphQL update PR it created, the WSOD went away (without having to change ENABLE_GATSBY_REFRESH_ENDPOINT to false- we've always had it set to true)

tqureshi-uog avatar Oct 17 '23 19:10 tqureshi-uog

@tqureshi-uog I don't have GraphQL package in my package.json. Should I add it?

hasanshafiq29 avatar Oct 17 '23 20:10 hasanshafiq29

We don't have it in our package.json either - it's a dependency of Gatsby itself, I believe. When dependabot created its automated PR, only our package-lock.json file changed.

tqureshi-uog avatar Oct 17 '23 20:10 tqureshi-uog

@tqureshi-uog I checked my yarn-lock file and it already has v16.8.1 of GraphQL. I tried deleting yarn.lock and node modules and running yarn install but still it didn't solve the issue

hasanshafiq29 avatar Oct 17 '23 20:10 hasanshafiq29

BUMP

hasanshafiq29 avatar Oct 20 '23 20:10 hasanshafiq29

BUMP

hasanshafiq29 avatar Oct 23 '23 17:10 hasanshafiq29

BUMP

Vacilando avatar Oct 24 '23 14:10 Vacilando

@Vacilando

Can you tell me how you are facing this issue?

hasanshafiq29 avatar Oct 24 '23 21:10 hasanshafiq29

@hasanshafiq29

At http://localhost:8000/___graphql I was getting a white screen with console errors about "TooltipProvider".

After changing: ~~ENABLE_GATSBY_REFRESH_ENDPOINT=true~~ to ENABLE_GATSBY_REFRESH_ENDPOINT=false in .env.development I can work again with the GraphQL interface.

But this is rather a workaround than a solution, of course.

Vacilando avatar Oct 24 '23 21:10 Vacilando

I think previously people here suggested to set ENABLE_GATSBY_REFRESH_ENDPOINT=false But you said that its working when its true. @Vacilando

hasanshafiq29 avatar Oct 25 '23 18:10 hasanshafiq29

I remain convinced it's due to a rogue dependency somewhere within Gatsby's implementation of GraphQL. Since I use npm, I'm not sure what the equivalent command is for yarn, but if it has its own version of npm clean install, try that...?

tqureshi-uog avatar Oct 25 '23 19:10 tqureshi-uog

I think previously people here suggested to set ENABLE_GATSBY_REFRESH_ENDPOINT=false But you said that its working when its true. @Vacilando

@hasanshafiq29 my mistake, sorry. I've corrected my post above.

Vacilando avatar Oct 25 '23 19:10 Vacilando

I thought ENABLE_GATSBY_REFRESH_ENDPOINT was a flag and I was setting it false in gatsby-config.js But then I saw that I have to set it in the ENV. Now by setting it false, the error is gone But still I think we need to keep this issue open as its only a way around

hasanshafiq29 avatar Oct 25 '23 19:10 hasanshafiq29

Experiencing the same issue (GraphiQL editor WSOD) when upgrading from Gatsby 5.9.x to 5.12.x

Issue seems to be happening for us on all versions of Gatsby past 5.9.x:

  • 5.10.x
  • 5.11.x
  • 5.12.x

The error is the same as mentioned above: Tooltip must be used within TooltipProvider

Can also confirm the same behaviour as @tcmacdonald and @ccesare above re: changing ENABLE_GATSBY_REFRESH_ENDPOINT to false fixes the WSOD problem > 5.9.x, however this isn't a suitable workaround for us as we need the endpoint working.

o-michael-o avatar Nov 01 '23 02:11 o-michael-o

I am also getting Error: Tooltipmust be used withinTooltipProvider`` I reverted back even down to Gatsby 5.1 and the error was still there. It started to happen my project when I upgraded from Gatsby 4 to 5 I temporarily applied the suggested workaround to removed ENABLE_GATSBY_REFRESH_ENDPOINT from my .env file and it worked. But I need this to be fixed to set up the preview server and get the refreshing content. It is not only the white screen and blank page on ___graphql but also the refresh endpoint is showing 404 and does not update the content.

rahimimo avatar Nov 06 '23 18:11 rahimimo

I don’t want to confuse the issue… my situation was a little bit different, but maybe this will help someone.

I had the same Tooltip error and behavior a couple weeks ago, running Gatsby 5.7, and it seemed to start out of nowhere – I didn’t update anything Gatsby-related or within my project. To my knowledge, the only thing I updated was my local VS Code.

After completely nuking my local project and restarting Gatsby develop, I was able to get a second error, and this is what allowed me to troubleshoot further.

Screenshot 2023-09-19 at 2 58 20 PM

Something, somewhere is using this @parcel/watcher library.  And in July, they changed up the architecture and don't include all the binaries for every operating system. https://github.com/parcel-bundler/watcher/releases/tag/v2.2.0

I don't know if it's Gatsby or VS Code or what, but I now have to include this in my package.json:

"optionalDependencies": {
    "@parcel/watcher-darwin-x64": "2.2.0"
  },

This ^^ fixed my Tooltip error. I wish I could explain it better, but this worked for me.

kimdomenick avatar Nov 06 '23 19:11 kimdomenick

I applied the above but did not fix.

What FIXED my issue is replacing gatsby-graphiql-explorer "^3.12.1" by gatsby-graphiql-explorer "<^3.12.0" in my yarn.lock and removing the old resolved in the yarn.lock

[email protected]:
  version "3.12.1"
  resolved "https://registry.yarnpkg.com/gatsby-graphiql-explorer/-/gatsby-graphiql-explorer-3.12.1.tgz#c49f3ddc623259f313085bd6190bf2e36b89860e"
  integrity sha512-ugm5vUBP0AQ4Dr5cMqegi2hURCIxlFEahP1f+w7H10kwQ1VR/OIKLGW46JcrnF8LGPmQ99bYTptL19Dv7hECXA==

and run yarn install which resulted in installing

gatsby-graphiql-explorer@<3.12.0:
  version "3.11.0"
  resolved "https://registry.yarnpkg.com/gatsby-graphiql-explorer/-/gatsby-graphiql-explorer-3.11.0.tgz#c49f3ddc623259f313085bd6190bf2e36b89860e"
  integrity sha512-ugm5vUBP0AQ4Dr5cMqegi2hURCIxlFEahP1f+w7H10kwQ1VR/OIKLGW46JcrnF8LGPmQ99bYTptL19Dv7hECXA==

then removing the public and cache folder and run the gatsby develop

It has nothing to do with the gatsby version, it is the upadte in the gatsby-graphiql-explorer which has caused the issue and upgrading to gatsby probably as a side effect upgrade the existing grqphql-explorer.

With this workaround you do not have to set the refresh flag to off.

rahimimo avatar Nov 08 '23 09:11 rahimimo

I can confirm that rolling back to 3.11.0 got it working again for me: npm i [email protected]

I'm currently working with gatsby 5.12.7

phpMagpie avatar Nov 14 '23 13:11 phpMagpie

This is still happening with the latest version of Gatsby and none of the above-mentioned fixes work.

maria404 avatar Jan 08 '24 20:01 maria404

Commenting out ENABLE_GATSBY_REFRESH_ENDPOINT=true from my dev env file fixed it for me.

I was getting the exact same error as OP, the tooltip thing

GarethChetwood avatar Jan 10 '24 15:01 GarethChetwood

none of the ideas here worked for me, still can't get it to work.

ItsMeAra avatar Jan 25 '24 17:01 ItsMeAra

World class React framework

Anybody who chooses Gatsby in 2024 is in for a wild ride

EKarpinsky avatar Feb 09 '24 17:02 EKarpinsky