chartjs / chartjs-plugin-zoom

Zoom and pan plugin for Chart.js
MIT License
585 stars 324 forks source link

Error [ERR_PACKAGE_PATH_NOT_EXPORTED] #709

Open Hasan-dihaz opened 1 year ago

Hasan-dihaz commented 1 year ago

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

engelnico commented 1 year ago

bump. i'm getting the same error. Is there something we can do?

hugo-valcourt commented 1 year ago

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

hugo-valcourt commented 1 year ago

See https://github.com/chartjs/chartjs-plugin-annotation/issues/814

hugo-valcourt commented 1 year ago

working after upgrade

rajdtta commented 1 year ago

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'
}
calin-stan commented 1 year ago

@rajdtta You seem to be using NextJS. I had the exact same error, and this helped me fix it