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.

[v3] Typescript errors using ESM

See original GitHub issue

Describe 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

  1. Go to the CodeSandbox
  2. 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:closed
  • Created 10 months ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
ardatancommented, Nov 29, 2022

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.

1reaction
ardatancommented, Nov 28, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

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