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

fix: Missing lru-cache dependency #4600

Merged
merged 3 commits into from
Oct 5, 2020
Merged

fix: Missing lru-cache dependency #4600

merged 3 commits into from
Oct 5, 2020

Conversation

oliversalzburg
Copy link
Contributor

signatureCache in usageReporting uses it, so it needs to be declared.

signatureCache in usageReporting uses it, so it needs to be declared.
@oliversalzburg oliversalzburg changed the title fix: Missing lru-dependency fix: Missing lru-cache dependency Sep 27, 2020
@abernix abernix changed the base branch from main to release-2.19.0 October 5, 2020 13:25
Copy link
Member

@abernix abernix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Ref: #4453

@abernix abernix added this to the Release 2.19.0 milestone Oct 5, 2020
@abernix abernix merged commit 6a51396 into apollographql:release-2.19.0 Oct 5, 2020
@oliversalzburg oliversalzburg deleted the fix/lru-cache-dep branch October 5, 2020 13:56
@glasser
Copy link
Member

glasser commented Oct 5, 2020

Does this break the use of v2.18 in some cases? Should I rush this out as a v2.18.2, since I think v2.19 is going to go out until next week due to @jsegaran 's schedule?

@oliversalzburg
Copy link
Contributor Author

oliversalzburg commented Oct 5, 2020

I noticed problems with this when using yarn2 with PnP. Those problems can be worked around though.

For completeness, this would locally resolve the issue through .yarnrc.yml:

packageExtensions:
  apollo-server-core@*:
    dependencies:
      lru-cache: "*"

Without that override, users may be unable to start Apollo server if an Apollo Studio API key is provided and schema reporting is enabled. In such a case, users will see the following error:

/home/oliver/fairmanager/backend/core-web3/.pnp.js:18150
  return Object.defineProperties(new Error(message), {
                                 ^

Error: apollo-server-core tried to access lru-cache, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: lru-cache (via "lru-cache")
Required by: apollo-server-core@virtual:2863b77f896288a34e8cf6e680a24e8a807ca93488044e012533af520a8f6ffbcfeecde8ba8d683ee29b1c135bd7e1600d758842f436d15d071668e1c246e3c5#npm:2.18.1 (via /home/oliver/fairmanager/backend/core-web3/.yarn/$$virtual/apollo-server-core-virtual-4e6dbc9000/0/cache/apollo-server-core-npm-2.18.1-9f020f54c3-68b6565dae.zip/node_modules/apollo-server-core/dist/plugin/usageReporting/)

Require stack:
- /home/oliver/fairmanager/backend/core-web3/.yarn/$$virtual/apollo-server-core-virtual-4e6dbc9000/0/cache/apollo-server-core-npm-2.18.1-9f020f54c3-68b6565dae.zip/node_modules/apollo-server-core/dist/plugin/usageReporting/signatureCache.js
- /home/oliver/fairmanager/backend/core-web3/.yarn/$$virtual/apollo-server-core-virtual-4e6dbc9000/0/cache/apollo-server-core-npm-2.18.1-9f020f54c3-68b6565dae.zip/node_modules/apollo-server-core/dist/plugin/usageReporting/plugin.js
- /home/oliver/fairmanager/backend/core-web3/.yarn/$$virtual/apollo-server-core-virtual-4e6dbc9000/0/cache/apollo-server-core-npm-2.18.1-9f020f54c3-68b6565dae.zip/node_modules/apollo-server-core/dist/plugin/usageReporting/index.js
- /home/oliver/fairmanager/backend/core-web3/.yarn/$$virtual/apollo-server-core-virtual-4e6dbc9000/0/cache/apollo-server-core-npm-2.18.1-9f020f54c3-68b6565dae.zip/node_modules/apollo-server-core/dist/plugin/index.js
- /home/oliver/fairmanager/backend/core-web3/.yarn/$$virtual/apollo-server-core-virtual-4e6dbc9000/0/cache/apollo-server-core-npm-2.18.1-9f020f54c3-68b6565dae.zip/node_modules/apollo-server-core/dist/ApolloServer.js
- /home/oliver/fairmanager/backend/core-web3/.yarn/$$virtual/apollo-server-core-virtual-4e6dbc9000/0/cache/apollo-server-core-npm-2.18.1-9f020f54c3-68b6565dae.zip/node_modules/apollo-server-core/dist/index.js
- /home/oliver/fairmanager/backend/core-web3/.yarn/$$virtual/apollo-server-koa-virtual-2863b77f89/0/cache/apollo-server-koa-npm-2.18.1-21cf2948f2-48849653d8.zip/node_modules/apollo-server-koa/dist/index.js
- /home/oliver/fairmanager/backend/core-web3/dist/plugins/QueryComplexityPlugin.js
- /home/oliver/fairmanager/backend/core-web3/dist/container/Application.js
- /home/oliver/fairmanager/backend/core-web3/dist/main.js
    at internalTools_makeError (/home/oliver/fairmanager/backend/core-web3/.pnp.js:18150:34)
    at resolveToUnqualified (/home/oliver/fairmanager/backend/core-web3/.pnp.js:19109:23)
    at resolveRequest (/home/oliver/fairmanager/backend/core-web3/.pnp.js:19201:29)
    at Object.resolveRequest (/home/oliver/fairmanager/backend/core-web3/.pnp.js:19279:26)
    at Function.external_module_.Module._resolveFilename (/home/oliver/fairmanager/backend/core-web3/.pnp.js:18383:34)
    at Function.external_module_.Module._load (/home/oliver/fairmanager/backend/core-web3/.pnp.js:18248:48)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/oliver/fairmanager/backend/core-web3/.yarn/$$virtual/apollo-server-core-virtual-4e6dbc9000/0/cache/apollo-server-core-npm-2.18.1-9f020f54c3-68b6565dae.zip/node_modules/apollo-server-core/dist/plugin/usageReporting/signatureCache.js:7:37)
    at Module._compile (internal/modules/cjs/loader.js:1085:30)

Sorry for not providing the information initially. I was in a hurry :(

glasser pushed a commit that referenced this pull request Oct 5, 2020
Relates to #4453.

Co-authored-by: Jesse Rosenberger <git@jro.cc>
@glasser glasser mentioned this pull request Oct 5, 2020
@glasser
Copy link
Member

glasser commented Oct 5, 2020

Thanks, see #4628

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 this pull request may close these issues.

3 participants