Do not activate polyfills automatically when using Apollo Server.
See original GitHub issuewhen using node10, the method Array.flat
does not exist. but, if i require apollo-server-express
first, then it suddenly starts to exist.
try this example code:
console.log([].flat);
require('apollo-server-express');
console.log([].flat);
if you run it with node10, you get:
undefined
[Function: flat]
what i would like to happen is:
undefined
undefined
a module should not modify the global namespace.
seems a polyfill gets activated. i started to dig into the dependencies-tree, and it seems it goes:
apollo-server-express
> apollo-server-core
> @apollographql/apollo-tools
> apollo-env
> core-js
so technically apollo-env
is the one that activates the polyfill, but i do not know what that module does or why is it used, so i decided to create the bugreport here.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Migrating to Apollo Server 4 - Apollo GraphQL Docs
If you are using apollo-server-express 's default /graphql URL path (i.e., not specifying another URL with the path option), you can mount expressMiddleware ......
Read more >React, Apollo-server url problem - Help
Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: -...
Read more >API Reference: ApolloServer - Apollo GraphQL Docs
Under the hood, Apollo Server automatically generates this field from ... If you're using startStandaloneServer you do not need to start your server...
Read more >Subscriptions in Apollo Server - Apollo GraphQL Docs
Subscriptions are not supported by Apollo Server 4's startStandaloneServer function. To enable subscriptions, you must first swap to using the ...
Read more >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
We just wasted 2 hours tracking down an issue that was exactly this. What’s the status of ripping out the polyfill behavior? It’s honestly unacceptable for a runtime library.
@glasser can we get an v3 alpha release of
apollo-server-core
on npm with #5244 merged. Or can you tell me how to bundle it locally, so we can use it in our custom cloudflare workers integration, which currently fails because of this.