This upgrades to Apollo Server 2.21 and makes a Webpack configuration change to make it possible to bundle that new version.
Per the comment added within the Webpack configuration which aliases the 'tls' and 'net' modules in the resulting bundle to empty modules:
The 'net' and 'tls' Node.js built-in usage within Apollo Server is merely to run instanceof checks against an existing, user-supplied "server" instance when subscriptions are desired to be bound to an already-created server. For the purposes of Cloudflare, where none of these Node.js builtins exist, this instanceof check is irrelevant because such a class could not exist.
This upgrades to Apollo Server 2.21 and makes a Webpack configuration change to make it possible to bundle that new version.
Per the comment added within the Webpack configuration which aliases the 'tls' and 'net' modules in the resulting bundle to empty modules:
The 'net' and 'tls' Node.js built-in usage within Apollo Server is merely to run
instanceof
checks against an existing, user-supplied "server" instance when subscriptions are desired to be bound to an already-created server. For the purposes of Cloudflare, where none of these Node.js builtins exist, this instanceof check is irrelevant because such a class could not exist.This is necessary as of the introduction of those
instanceof
checks in https://github.com/apollographql/apollo-server/commit/8ab0e90724d8d35ad.