tsc error: Cannot find module 'graphql' or its corresponding type declarations
See original GitHub issuePrerequisites
- I confirm my issue is not in the opened issues
- I confirm the Frequently Asked Questions didn’t contain the answer to my issue
Environment check
- I’m using the latest
msw
version - I’m using Node.js version 14 or higher
Node.js version
v16.11.0
Reproduction repository
https://github.com/takanokana/msw-for-issue
Reproduction steps
1.npm ci 2. npm run typecheck
Current behavior
node_modules/msw/lib/index.d.ts:4:63 - error TS2307: Cannot find module ‘graphql’ or its corresponding type declarations.
4 import { GraphQLError, OperationTypeNode, DocumentNode } from ‘graphql’;
Expected behavior
No errors when executing tsc.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Typescript: import fail: Cannot find module 'query.gql' #59
Try adding type declaration DocumentNode from graphql typings. // index.d.ts import { DocumentNode } from 'graphql' ...
Read more >Ask Question - Stack Overflow
How to solve the Error: Cannot find module '../graphql/queries.graphql' or its corresponding type declarations' in an angular project.
Read more >Cannot find module 'types/graphql' or its corresponding type ...
So I generate a cell in a typescript project and it's complaining Cannot find module 'types/graphql' or its corresponding type declarations.
Read more >graphql-typescript-definitions - npm
This package will generate matching .d.ts files for each .graphql file you specify. It will generate types in the following format: A default ......
Read more >cannot find module 'process' or its corresponding type ...
Cannot find name 'process'. Do you need to install type definitions for node? Try npm i --save-dev @types/node and then add node to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’re opening a fix in https://github.com/mswjs/msw/pull/1381. Everyone is welcome to participate in the discussion there.
As a first step, I wonder if a patch release removing the optional peerDependency Meta might be a stopgap (npm should, i believe, install peers automatically - but not 100% sure offhand). From there, most users shouldn’t be warned / see errors.
After that - Separating out the graphql entry might be possible, but not super clear yet