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

[Bug]: Support canvas 3.x version as peer dependency of jest-environment-jsdom package #15507

Open
mmanovic opened this issue Feb 14, 2025 · 2 comments

Comments

@mmanovic
Copy link

Version

29.7.0

Steps to reproduce

jest-environment-jsdom package currently is not supporting the latest major canvas version 3.x https://github.com/Automattic/node-canvas/releases

Expected behavior

npm install is passing when we are using canvas 3.x version

Actual behavior

npm install
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/canvas
npm error canvas@"3.1.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peerOptional canvas@"^2.5.0" from [email protected]
npm error node_modules/jest-environment-jsdom
npm error jest-environment-jsdom@"^29.7.0" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/canvas
npm error peerOptional canvas@"^2.5.0" from [email protected]
npm error node_modules/jest-environment-jsdom
npm error jest-environment-jsdom@"^29.7.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

Additional context

No response

Environment

Windows 11
@Tockra
Copy link

Tockra commented Feb 21, 2025

I ran into the same issue. Currently I build my project with npm ci --legacy-peer-deps but it is very annoying that every installation needs a --force now to ignore the above problem.
I would really like a fix ;)

@mmanovic
Copy link
Author

@Tockra Just info, you can temporarily avoid using --force by adding
"overrides": { "jest-environment-jsdom": { "canvas": "$canvas" } }
to your package.json file.

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

No branches or pull requests

2 participants