-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript issue with moduleResolution: NodeNext
#10628
Comments
Duplicate of #10599 |
Nope, again: all chart.js version has this issue. You are definitely closing issues too casually, as I do think that we are reporting different things. |
Only v3.9 has anything with .mts extension, so all versions can not possibly have this particular issue.
The errors reported are identical in these issues. The tooling used is different, but its the same issue anyway. |
Are you 2 guys kidding me? What I am reporting is that TypeScript requires
|
Thank you for the clarification. I did not recall the types folder imports were without extension. From the typescript docs its not obvious if imports pointing to a directory would read the index.d.(m|c)ts or does it need to be explicit too? (v4 auto package imports from a directory currently) v4 is going to emit the types: I'm not sure if there is a will to update the type imports for v3. As always you are welcome to create a PR for that against the 3.9 branch. And before you ask, there is no date for v4. It could be soon or later - because this is an open source project and for it to go forward, it needs time investment from contributors. |
For the latest moduleResolution import a from './dir/index.js'; And Since we are outputing esm bundle in 3.9, I was thinking we'd better to convert the exisiting code to a valid esm code in typescript. But as you are mentioning v4, I looked at the main branch, if you are planing to release v4 very soon (I probably mean in 30 days) I think we can make the changes only in v4, and make a depercated message in 3.9 esm bundle to tell users it's broken. It's not very hard to make a workaround though If anyone meets the same issue and needs a workaround, I would be happy to leave some pieces here. |
@kurkle @LeeLenaleee I will research this issue soon. |
Expected behavior
Current behavior
Cuurently chart.js 's declaration files can not work with
moduleResolution: NodeNext
when targeting esm.(Both with
chart.js
andchart.js/auto
)I think that al least
chart.js/auto
should respect latest typescript requirements on esm.See https://www.typescriptlang.org/docs/handbook/esm-node.html for more details. This is somthing ts adds support in 4.7
Reproducible sample
Not related to chart runtime code
Optional extra steps/info to reproduce
No response
Possible solution
.js
externsion for all files in source coderollup=plugin-dts
to bundle a.d.mts
declaration file forauto.mts
to avoid a relative import without extension instead of creating a declaration wrapper.Context
No response
chart.js version
all chart.js version are having this issue
Browser name and version
No response
Link to your project
No response
The text was updated successfully, but these errors were encountered: