Bug: type issue in ts@4.8+ with esm #3817
Labels
Status: Triage
Needs to be verified, categorized, etc
Type: Bug / Error
Something isn't working or is incorrect
Description
The package is shipping esm files, but package.json is declaring
"type": "commonjs"
by mistakeSo typescript will assume users are importing a commonjs module, so it will report issues with:
Saying the expression is not callable.
That's because a cjs module will have it's module.exports on default key, so:
is ok to typescript, but it's not acually working (because we do have esm modules using export default) and the default key does not exisit.
Steps to reproduce
Create project with
"type": "module"
and install mermaid. then ensure ts.config.json hastarget: "ESxxx"
, you will get issues mention above. (Does not need to usemoduleResolution: NodeNext
)Screenshots
No response
Code Sample
No response
Setup
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: