Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in apollo-server-plugin-response-cache #5804

Closed
wenoweno opened this issue Oct 11, 2021 · 1 comment · Fixed by #5816
Closed

Error in apollo-server-plugin-response-cache #5804

wenoweno opened this issue Oct 11, 2021 · 1 comment · Fixed by #5816

Comments

@wenoweno
Copy link

Hello everyone, I got this error

Error: Cannot find module 'apollo-server-types'
[1] Require stack:
[1] - /project/node_modules/apollo-server-plugin-response-cache/dist/ApolloServerPluginResponseCache.js
[1] - /project/node_modules/apollo-server-plugin-response-cache/dist/index.js
[1] - /project/packages/package1/src/server/start.ts
[1] - /project/packages/package1/src/server/index.ts
[1]     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
[1]     at Function.Module._resolveFilename (/project/node_modules/tsconfig-paths/lib/register.js:75:40)
[1]     at Function.Module._load (internal/modules/cjs/loader.js:746:27)
[1]     at Module.require (internal/modules/cjs/loader.js:974:19)
[1]     at require (internal/modules/cjs/helpers.js:92:18)
[1]     at Object.<anonymous> (/project/node_modules/apollo-server-plugin-response-cache/src/ApolloServerPluginResponseCache.ts:8:1)
[1]     at Module._compile (internal/modules/cjs/loader.js:1085:14)
[1]     at Module._compile (/project/node_modules/source-map-support/source-map-support.js:547:25)
[1]     at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
[1]     at Object.nodeDevHook [as .js] (/project/node_modules/ts-node-dev/lib/hook.js:63:13)
[1] [ERROR] 21:04:23 Error: Cannot find module 'apollo-server-types'
[1] Require stack:
[1] - /project/node_modules/apollo-server-plugin-response-cache/dist/ApolloServerPluginResponseCache.js
[1] - /project/node_modules/apollo-server-plugin-response-cache/dist/index.js
[1] - /project/packages/package1/src/server/start.ts
[1] - /project/packages/package1/src/server/index.ts

So, I look up the source code of ApolloServerPluginResponseCache in 'apollo-server-plugin-response-cache'.
From what I see, now package.json has apollo-server-types as devdependencies. However, ApolloServerPluginResponse js uses an enum called CacheScope, so an error seems to occur. Maybe this should be in dependencies, not devdependencies?

@wenoweno wenoweno changed the title error in apollo-server-plugin-response-cache Error in apollo-server-plugin-response-cache Oct 18, 2021
@glasser
Copy link
Member

glasser commented Oct 19, 2021

Thanks for the catch; fixing in #5816.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants