Skip to content
New issue

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

ERROR in ../../node_modules/chartjs-plugin-zoom/dist/chartjs-plugin-zoom.esm.js 327:2-10 export 'callback' (imported as 'callback') was not found in 'chart.js/helpers' (module has no exports) #10547

Closed
panw-contact opened this issue Aug 2, 2022 · 10 comments · Fixed by #10552

Comments

@panw-contact
Copy link

panw-contact commented Aug 2, 2022

Expected behavior

Versions used package.json:

"chart.js": "^3.8.0",
"chartjs-plugin-zoom": "1.0.1",
"react-chartjs-2": "^4.0.0",

No errors

Current behavior

export 'callback' (imported as 'callback') was not found in 'chart.js/helpers' (module has no exports)
 @ ./src/resources/subscription_mgmt/SubscriptionCreditsUsage.tsx 16:0-45 19:94-104
 @ ./src/resources/subscription_mgmt/index.ts 3:0-65 7:15-38
 @ ./src/resources/index.ts 16:0-52 17:0-155
 @ ./src/App.tsx 16:0-39 97:11-19
 @ ./src/index.tsx 8:0-24 10:38-41
ERROR in ../../node_modules/chartjs-plugin-zoom/dist/chartjs-plugin-zoom.esm.js 368:2-6
export 'each' (imported as 'each') was not found in 'chart.js/helpers' (module has no exports)
 @ ./src/resources/subscription_mgmt/SubscriptionCreditsUsage.tsx 16:0-45 19:94-104
 @ ./src/resources/subscription_mgmt/index.ts 3:0-65 7:15-38
 @ ./src/resources/index.ts 16:0-52 17:0-155
 @ ./src/App.tsx 16:0-39 97:11-19
 @ ./src/index.tsx 8:0-24 10:38-41
ERROR in ../../node_modules/chartjs-plugin-zoom/dist/chartjs-plugin-zoom.esm.js 376:2-10
export 'callback' (imported as 'callback') was not found in 'chart.js/helpers' (module has no exports)
 @ ./src/resources/subscription_mgmt/SubscriptionCreditsUsage.tsx 16:0-45 19:94-104
 @ ./src/resources/subscription_mgmt/index.ts 3:0-65 7:15-38
 @ ./src/resources/index.ts 16:0-52 17:0-155
 @ ./src/App.tsx 16:0-39 97:11-19
 @ ./src/index.tsx 8:0-24 10:38-41
ERROR in ../../node_modules/chartjs-plugin-zoom/dist/chartjs-plugin-zoom.esm.js 404:2-6
export 'each' (imported as 'each') was not found in 'chart.js/helpers' (module has no exports)

Module not found: Error: Can't resolve '../dist/helpers.esm' in node_modules/chart.js/helpers'
Did you mean 'helpers.esm.js'?

Reproducible sample

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

No response

chart.js version

v3.8.0

Browser name and version

Chrome

Link to your project

No response

@LeeLenaleee
Copy link
Collaborator

The sample you linked does not seem to throw any errors like you describe, can you update it to reflect the behaviour you see

@panw-contact
Copy link
Author

panw-contact commented Aug 2, 2022

we are using webpack and babel as mentioned above and hence the errors. It is unable to resolve ../dist/helpers.esm

@mlandalv
Copy link

mlandalv commented Aug 2, 2022

I think the problem is that chart.js/helpers/helpers.mjs is missing .js in the export path.

Should be.

export * from '../dist/helpers.esm.js';

@ghost
Copy link

ghost commented Aug 2, 2022

I found the same problem in my application today while i was deploying to heroku (same version of chart.js 3.8.0)

remote:        Creating an optimized production build...
remote:        Failed to compile.
remote:        
remote:        Module not found: Error: Can't resolve '../dist/helpers.esm' in '/tmp/build_69eec022/web_client/node_modules/chart.js/helpers'
remote:        Did you mean 'helpers.esm.js'?
remote:        BREAKING CHANGE: The request '../dist/helpers.esm' failed to resolve only because it was resolved as fully specified
remote:        (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
remote:        The extension in the request is mandatory for it to be fully specified.
remote:        Add the extension to the request.

in the node_module file inside './dist' there are only 2 files with the name 'helpers' and have the .esm.js and .mjs extensions.
I notice what @mlandalv indicates too, probably is the missing extension

My last deploy was on Friday so, may be this modifications are the origin of the issue commit here

@panw-contact
Copy link
Author

@mlandalv @JS-TCIT - what is the solution to fix this issue in my environment?
Is there a quick turnaround for this issue?

@shawnhooper
Copy link

Confirmed that this is happening in my environment as well. Updated package.json to have version 3.8.2 be installed and the build worked again.

@panw-contact
Copy link
Author

I changed it to 3.8.0 and it started working fine. But curious why this was pushed as part of v3 and not v4 if it is such a big change.

@etimberg
Copy link
Member

etimberg commented Aug 2, 2022

There was a bug with 3.8.1 that was resolved in 3.8.2. See #10513 for the fix

@genyslt
Copy link

genyslt commented Aug 3, 2022

export 'merge' (imported as 'merge') was not found in 'chart.js/helpers' (module has no exports)
 @ ..

ERROR in ../XWYZ/node_modules/chart.js/helpers/helpers.mjs 1:0-36
Module not found: Error: Can't resolve '../dist/helpers.esm' in '/XWYZ/node_modules/chart.js/helpers'
Did you mean 'helpers.esm.js'?
BREAKING CHANGE: The request '../dist/helpers.esm' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
resolve '../dist/helpers.esm' in '/XWYZ/node_modules/chart.js/helpers'
  using description file: /XWYZ/node_modules/chart.js/helpers/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: /XWYZ/node_modules/chart.js/package.json (relative path: ./dist/helpers.esm)

After upgrade from 3.8.2 to 3.9.0

@LeeLenaleee
Copy link
Collaborator

Fixed in #10552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants