Open Hasan-dihaz opened 1 year ago
bump. i'm getting the same error. Is there something we can do?
I got this from vitest
Error: No "exports" main defined in /Users/hugo/git/bwl/packages/bali-widgets-lib/node_modules/chart.js/package.json
note: Same for chartjs-plugin-annotation https://github.com/chartjs/chartjs-plugin-annotation/issues/819
working after upgrade
Upgrading fixed the PACKAGE_PATH_NOT_EXPORTED
issue, but now my application fails when reloading the page.
I get a ReferenceError saying that window
is not defined, seems to originate from hammerjs.
error - ReferenceError: window is not defined
at Object.<anonymous> (...node_modules/hammerjs/hammer.js:2643:4)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at .../node_modules/chartjs-plugin-zoom/dist/chartjs-plugin-zoom.js:8:110
at Object.<anonymous> (.../node_modules/chartjs-plugin-zoom/dist/chartjs-plugin-zoom.js:11:3)
at Module._compile (node:internal/modules/cjs/loader:1159:14) {
page: '/analytics/acc'
}
@rajdtta You seem to be using NextJS. I had the exact same error, and this helped me fix it
With chart.js(4.0.1) getting this error - Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in D:\node_e_modules\chart.js\package.json