You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @trevorblades, while I don't use this plugin directly, my configuration is more or less identical to it.
Recently in Gatsby v3, we started seeing "Unsafe built-in method was used" warnings as documented in the discussion thread I created here: gatsbyjs/gatsby#31753
TL;DR: It seems that any use of node-fetch throws these warnings that could potentially have impact on users who are on Gatsby Cloud (e.g. causes a full build vs incremental build).
All documentation from both Gatsby and Apollo to date has been pushing towards this configuration:
using an isomorphic fetch library
wrapping the Apollo Provider in both gatsby-browser.js AND gatsby-ssr.js
This seems to be problematic for Gatsby now. I haven't heard back from the Gatsby team on how to proceed, but I've also created a "Apollo Provider on Client-Side Only" test on my minimal repro here: ardiewen/gatsby-with-apollo-warning#1
I wanted to get your thoughts on this. The PR on my minimal repro no longer produces the "Unsafe built-in method" warning on build, but it DOES force components with hooks such as useQuery to be tested against client-side only logic. Otherwise, it will throw an SSR invariant violation error.
The text was updated successfully, but these errors were encountered:
Hey @ardiewen, do you know if node-fetch and isomorphic-fetch both share this problem when building for Gatsby Cloud? Did your discussion with the Gatsby team yield any new insight about this problem?
I've never personally seen this issue. Does it happen when building Gatsby v3 locally, or only on Gatsby Cloud? And does it happen when you're using this plugin, or your custom configuration? (or both?)
Hey @trevorblades , thanks for getting back to me. I opened the minimal reproduction again to verify based on your questions:
this is strictly a Gatsby Cloud issue. Building locally or on Netlify doesn't produce this warning.
isomorphic-fetch DOESN'T have this issue while cross-fetch AND isomorphic-unfetch do
isomorphic-fetch is implemented as a polyfill, while the others are implemented as ponyfill, so i tested the other two libraries as polyfills but unfortunately they still throw the same warning...
Hi @trevorblades, while I don't use this plugin directly, my configuration is more or less identical to it.
Recently in Gatsby v3, we started seeing "Unsafe built-in method was used" warnings as documented in the discussion thread I created here:
gatsbyjs/gatsby#31753
TL;DR: It seems that any use of node-fetch throws these warnings that could potentially have impact on users who are on Gatsby Cloud (e.g. causes a full build vs incremental build).
All documentation from both Gatsby and Apollo to date has been pushing towards this configuration:
gatsby-browser.js
ANDgatsby-ssr.js
This seems to be problematic for Gatsby now. I haven't heard back from the Gatsby team on how to proceed, but I've also created a "Apollo Provider on Client-Side Only" test on my minimal repro here:
ardiewen/gatsby-with-apollo-warning#1
I wanted to get your thoughts on this. The PR on my minimal repro no longer produces the "Unsafe built-in method" warning on build, but it DOES force components with hooks such as
useQuery
to be tested against client-side only logic. Otherwise, it will throw an SSR invariant violation error.The text was updated successfully, but these errors were encountered: