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

Hammer import crashes Rollup build (ESM version) #917

Open
marisst opened this issue Jan 3, 2025 · 0 comments
Open

Hammer import crashes Rollup build (ESM version) #917

marisst opened this issue Jan 3, 2025 · 0 comments

Comments

@marisst
Copy link

marisst commented Jan 3, 2025

I integrate the Zoom plugin in my code like this:

import zoomPlugin from 'chartjs-plugin-zoom';

Then I run a Rollup build:

 npm run build

The build crashes with the following error:

crash

In order to fix the build, I go manually edit chartjs-plugin-zoom.esm.js and replace line 7:

import Hammer from 'hammerjs';

with

import 'hammerjs';

I could not find an official guide how to integrate Hammer ESM package, but this Stackoverflow answer seems to have a lot of votes and here I found the solution.

If would be great to fix this in the source code, so this fix doesn't have to be done manually after every install or update of the npm package.

@marisst marisst changed the title Hammer import causes Rollup build crash (ESM version) Hammer import crashes Rollup build (ESM version) Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant