[v3] Typescript errors using ESM
See original GitHub issueDescribe the bug
I am using ESM and after upgrade to graphql-yoga
v3 I am getting typescript errors.
Your Example Website or App
https://codesandbox.io/s/serverless-wave-xtqn9z
Steps to Reproduce the Bug or Issue
- Go to the CodeSandbox
- Run
npm run check
Expected behavior
No Typescript errors when use ESM, as on previos version.
Screenshots or Videos
No response
Platform
- OS: Linux
- NodeJS: v18.8.0
graphql-yoga
version(s): 3.1.0
Additional context
No response
Issue Analytics
- State:
- Created 10 months ago
- Comments:6
Top Results From Across the Web
Documentation - ECMAScript Modules in Node.js - TypeScript
js has been working to support running ECMAScript modules (ESM). This has been a very difficult feature to support, since the foundation of...
Read more >"moduleResolution": "NodeNext" throws ESM related errors ...
The main issue with ESM and nodenext / node16 mode is TypeScript refusing to add .js extensions to the generated import statements in...
Read more >How can I resolve ESM / require error using TS 4.8?
I use Node.js application and TS 4.8, and I updated package file-type , but now my project compilation fails with error.
Read more >TypeScript and native ESM on Node.js - 2ality
In this blog post, I'll explain everything you need to know in order to use and produce native ECMAScript modules on Node.js.
Read more >Errors | Node.js v19.3.0 Documentation
Errors #. Applications running in Node.js will generally experience four categories of errors: Standard JavaScript errors such as <EvalError>, <SyntaxError>, ...
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
Now I see the issue. It is a TS error coming from the internal typings of Yoga. I’ll create a PR to fix it. For now, you can enable
skipLibCheck
because I don’t think you would actually need to check libraries’ typings.It doesn’t work because you didn’t configure TS-Node to work in ESM. https://codesandbox.io/s/priceless-wescoff-idvkcj?file=/package.json