apollographql / apollo-feature-requests

🧑‍🚀 Apollo Client Feature Requests | (no 🐛 please).
Other
130 stars 7 forks source link

Please add polyfill for `globalThis` as it breaks compatibility for Chrome < v71 #421

Closed kpervin closed 9 months ago

kpervin commented 9 months ago

For versions of @apollo/client 3.8.*, the use of globalThis.__DEV__ was introduced. We have a chrome client that cannot be upgraded past v68 atm and this breaks compatibility by causing ReferenceError: globalThis is not defined. Please add a polyfill (possibly from https://polyfill.io/v3/polyfill.min.js?features=globalThis) to the output of @apollo/client so that this error is not encountered on older browsers.

alessbell commented 9 months ago

Hi @kpervin 👋 Have you seen our docs on reducing bundle size? You can remove globalThis.__DEV__ at build time.

kpervin commented 9 months ago

That looks to have fixed the issue, thanks!