chartjs / chartjs-plugin-deferred

Chart.js plugin to defer initial chart updates
https://chartjs-plugin-deferred.netlify.app/
MIT License
108 stars 21 forks source link

ERR_PACKAGE_PATH_NOT_EXPORTED Server error #32

Closed dorisip closed 1 year ago

dorisip commented 1 year ago

Version:

├── chart.js@4.0.1
├── chartjs-plugin-deferred@2.0.0

Stacktrace

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './helpers' is not defined by "exports" in /Users/doris/src/node_modules/chart.js/package.json
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:638:7)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at /Users/doris/src/node_modules/chartjs-plugin-deferred/dist/chartjs-plugin-deferred.js:8:89 {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

I think it's the same issues reported in other chartjs plugins: https://github.com/chartjs/chartjs-plugin-annotation/issues/819 https://github.com/chartjs/chartjs-plugin-zoom/issues/709

gregh3269 commented 1 year ago

If I use

I get: Uncaught SyntaxError: import declarations may only appear at top level of a module Uncaught TypeError: can't access property "helpers", e.Chart is undefined

Using the umd version seems to work.

dorisip commented 1 year ago

this appears to work on chart.js version 4.1.1

though chartjs-plugin-deferred is documented to support chart.js 3.x