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
In a project embedding chart.js, the TypeScript transpilation with the following options works successfully:
"isolatedModules": true,
"skipLibCheck": false.
Current behavior
Transpilation fails because of en exported const enum:
node_modules/chart.js/dist/types/index.d.ts:579:39 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.
579 export type UpdateMode = keyof typeof UpdateModeEnum;
~~~~~~~~~~~~~~
Found 1 error in node_modules/chart.js/dist/types/index.d.ts:579
Expected behavior
In a project embedding
chart.js
, the TypeScript transpilation with the following options works successfully:"isolatedModules": true
,"skipLibCheck": false
.Current behavior
Transpilation fails because of en exported
const enum
:More explanation here: https://ncjamieson.com/dont-export-const-enums/
Reproducible sample
https://stackblitz.com/edit/vitejs-vite-y2wwyb?file=tsconfig.json
Optional extra steps/info to reproduce
Take a look at the terminal at the bottom of the page to see the transpilation error
Possible solution
Make
UpdateModeEnum
a simpleenum
, not aconst
one maybe.Context
No response
chart.js version
v4.2.0
Browser name and version
No response
Link to your project
No response
The text was updated successfully, but these errors were encountered: