You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The TS types for CJS are not exported correctly, which causes the "module": "node16" and "moduleResolution": "node16" to report errors. See this repo for reproduction: https://github.com/zirkelc/happy-dom-types-node16
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
I have experienced this issue multiple times with different packages. For example, LangChain had the same problem which I described here: langchain-ai/langchainjs#4060 (comment)
When you export CJS files as index.cjs, then you need to export the corresponding type declarations as index.d.cts and not index.d.ts. Here is a short video that demonstrates the fix:
2024-05-08_09-04-41.mp4
As you can see, all you need to do is to change the file extension.
Last but not least: thank you for work on this package!
The text was updated successfully, but these errors were encountered:
Describe the bug
The TS types for CJS are not exported correctly, which causes the
"module": "node16"
and"moduleResolution": "node16"
to report errors. See this repo for reproduction: https://github.com/zirkelc/happy-dom-types-node16Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
I have experienced this issue multiple times with different packages. For example, LangChain had the same problem which I described here: langchain-ai/langchainjs#4060 (comment)
When you export CJS files as
index.cjs
, then you need to export the corresponding type declarations asindex.d.cts
and notindex.d.ts
. Here is a short video that demonstrates the fix:2024-05-08_09-04-41.mp4
As you can see, all you need to do is to change the file extension.
Last but not least: thank you for work on this package!
The text was updated successfully, but these errors were encountered: