We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
No "exports" main defined
Running vitest in a project that uses chart.js v4 and chartjs-adapter-date-fns v2.0.1 results in:
chartjs-adapter-date-fns
Error: No "exports" main defined in [redacted]/node_modules/chart.js/package.json ❯ node_modules/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.js:8:72 6| */ 7| (function (global, factory) { 8| typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('chart.js'), require('date-fns')) : | ^ 9| typeof define === 'function' && define.amd ? define(['chart.js', 'date-fns'], factory) : 10| (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Chart, global.dateFns));
This is similar to this other comment
Here is a repro using stackblitz: https://stackblitz.com/edit/vitest-dev-vitest-7iyfoz?file=test/basic.test.ts
The test just imports chartjs-adapter-date-fns.
A potential fix is to add the exports field to the adapter package.json:
"exports": { ".": { "import": "./dist/chartjs-adapter-date-fns.esm.js", "require": "./dist/chartjs-adapter-date-fns.js" } }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Running vitest in a project that uses chart.js v4 and
chartjs-adapter-date-fns
v2.0.1 results in:This is similar to this other comment
Here is a repro using stackblitz: https://stackblitz.com/edit/vitest-dev-vitest-7iyfoz?file=test/basic.test.ts
The test just imports
chartjs-adapter-date-fns
.A potential fix is to add the exports field to the adapter package.json:
The text was updated successfully, but these errors were encountered: