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,
in the last version of @apollo/utils.keyvaluecache package there is this line return prefixesAreUnnecessaryForIsolationSymbol in c; which breaks our apollo server instance (tested on node v16 and v18).
It throws this error:
TypeError: Cannot use 'in' operator to search for 'Symbol(prefixesAreUnnecessaryForIsolation)' in bounded
at Function.prefixesAreUnnecessaryForIsolation (/app/node_modules/@apollo/server/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.js:27:57)
at new PrefixingKeyValueCache (/app/node_modules/@apollo/server/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.js:9:36)
at new ApolloServer (/app/node_modules/@apollo/server/dist/cjs/ApolloServer.js:110:28)
I was testing it on @apollo/server version 4.2.1 which creates objectPrefixingKeyValueCache like this:
new utils_keyvaluecache_1.PrefixingKeyValueCache(config.persistedQueries?.cache ?? this.cache, requestPipeline_js_1.APQ_CACHE_PREFIX),
if (PrefixingKeyValueCache.prefixesAreUnnecessaryForIsolation(wrapped)) {
Uses mentioned function prefixesAreUnnecessaryForIsolation called with "bounded" string in params which turns into faulty code Symbol(prefixesAreUnnecessaryForIsolation) in "bounded".
Is it a problem of @apollo/server or of @apollo/utils.keyvaluecache? With previous version of utils.keyvaluecache (v2.0.1) everything worked fine.
The text was updated successfully, but these errors were encountered:
Hey @junajan, thanks for opening an issue and providing the details of the error.
cache: "bounded" is the default behavior for AS4 and you can just remove that configuration altogether.
However, we did run into this issue internally so @glasser merged a fix (apollographql/apollo-server#7241) which re-adds support for cache: "bounded" in AS4.2.2 AS4.3.0 (edited - thanks @glasser) (note that it's still a no-op, just no longer broken if you choose to do that).
So your 2 options are: drop the configuration (which I'd recommend) or update to latest AS version (or both!)
I like to mention that TypeScript prevents these kinds of errors. If you prefer to use JavaScript, you can still leverage the benefits of TypeScript in your editor VERY easily. A tsconfig like this at the root of your project or simply writing // @ts-check at the top of your files are a couple ways you can benefit from our typings without actually using TS in your project.
Hi,
in the last version of
@apollo/utils.keyvaluecache
package there is this linereturn prefixesAreUnnecessaryForIsolationSymbol in c;
which breaks our apollo server instance (tested on node v16 and v18).It throws this error:
I was testing it on
@apollo/server
version4.2.1
which creates objectPrefixingKeyValueCache
like this:With these params:
Where constructor on line 22:
Uses mentioned function
prefixesAreUnnecessaryForIsolation
called with "bounded" string in params which turns into faulty codeSymbol(prefixesAreUnnecessaryForIsolation) in "bounded"
.Is it a problem of
@apollo/server
or of@apollo/utils.keyvaluecache
? With previous version ofutils.keyvaluecache
(v2.0.1) everything worked fine.The text was updated successfully, but these errors were encountered: