chartjs-plugin-zoom icon indicating copy to clipboard operation
chartjs-plugin-zoom copied to clipboard

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]

Open Hasan-dihaz opened this issue 3 years ago • 6 comments

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

Hasan-dihaz avatar Nov 29 '22 04:11 Hasan-dihaz

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

engelnico avatar Dec 08 '22 20:12 engelnico

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 avatar Dec 09 '22 00:12 hugo-valcourt

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

hugo-valcourt avatar Dec 09 '22 14:12 hugo-valcourt

working after upgrade

hugo-valcourt avatar Dec 19 '22 18:12 hugo-valcourt

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 avatar Dec 19 '22 23:12 rajdtta

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

calin-stan avatar Dec 26 '22 15:12 calin-stan