The v3.4.0-beta.15 doesn't work buildless
See original GitHub issueIntended outcome:
Just working, as previous version.
Actual outcome:
I get an error when update from v3.4.0-beta.14
to v3.4.0-beta.15
:
This file is: https://github.com/graphql/graphql-js/blob/v15.2.0/src/jsutils/instanceOf.js#L14 But that file hasn’t changed since January 2020.
All works if I go back to v3.4.0-beta.14
.
I’m using the @web/dev-server.
How to reproduce the issue:
Just importing and setup Apollo Client.
Versions
It happens only in v3.4.0-beta.15
and v3.4.0-beta.16
.
All works if I go back to v3.4.0-beta.14
.
Reference: https://github.com/apollographql/apollo-client/pull/7399
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:11 (11 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@abdonrd Thanks for testing the betas and reporting this issue!
This is a consequence of https://github.com/apollographql/invariant-packages/pull/94, and it unfortunately reveals that the
graphql
package is not designed to be used without a build step, since it contains a naked reference to the globalprocess
variable. This is a common assumption in the React ecosystem, for better or worse.Does
@web/dev-server
have any build/minification options for replacing expressions likeprocess.env.NODE_ENV
with constant strings? If not, you may need to provide your own globalprocess.env
polyfill to keep using thegraphql
package without theglobal.process
stub thatts-invariant
was previously providing.The reason https://github.com/graphql/graphql-js/pull/2894 is relevant is that @IvanGoncharov mentioned they might stop using
process.env.NODE_ENV
ingraphql@16
, which would be a welcome improvement, since it would allowgraphql
to run in a browser without a build step.Thanks!
Yeah, Those were the only ones I found in apollo-elements, which tries its best to expose the full breadth of the core apis
@abdonrd shared this screenshot with me, which I’m reposting with permission
I reproduced this locally, then after confirming those 8 errors, I published a fix with some workarounds, mostly by reexporting type aliases. https://github.com/apollo-elements/apollo-elements/commit/30a31ea10f011ebc9231e4396f813bbe190a2006 see especially
packages/core/types.ts
in that diff.I haven’t gone over
/link
and friends as carefully (and certainly not/react
), but updating some of my demo apps so far has been smooth. I wouldn’t typically expect app-buildery kind of users to go mucking around too much with those types.Thanks 😄