question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'apollo-server-plugin-base' or its corresponding type declarations

See original GitHub issue

I’m using this library with graphql-yoga and fastify and I end up with having to install apollo-server-plugin-base because I’m getting this type error:


import type { ApolloServerPlugin } from 'apollo-server-plugin-base';
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error in node_modules/@graphql-hive/client/apollo.d.ts```

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
ardatancommented, Dec 19, 2022

@dotansimha I think a seperate package is the best option here

2reactions
davidruisingercommented, Sep 29, 2022

Intermediate fix:

Create a missing_apollo_types.d.ts (name does not matter) file in your project with the following content:

declare module 'apollo-server-plugin-base' {
  interface ApolloServerPlugin {
    _: unknown
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module 'apollo-server-core/dist ... - GitHub
When I attempt to compile my typescript code, I get the following series of ... node_modules/apollo-server-plugin-base/dist/index.d.ts:1:95 ...
Read more >
npm - TypeScript import issues in apollo-server-express ...
The import type syntax used in apollo-server-core isn't supported by the version of typescript that you're using (v3.6).
Read more >
apollo-server-plugin-base - npm
Start using apollo-server-plugin-base in your project by running `npm i ... indicating that this package has built-in type declarations.
Read more >
Migrating to Apollo Server 4 - Apollo GraphQL Docs
In Apollo Server 3, the apollo-server-core package defines an ApolloServer "base" class, which each integration package ( apollo-server-express , apollo-server- ...
Read more >
cannot find module or its corresponding type declarations
Add this tsconfig as the base config file in your tsconfig.json : ... Then doing F1 -> reload window. Or apparently by installing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found