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

Cheerio Update to 1.0.0 is breaking Enzyme 3.11.0 for Node < 18.17.0 #2606

Closed
13 tasks
RaghavAgrawal-TUL-Luxury opened this issue Aug 12, 2024 · 7 comments
Closed
13 tasks

Comments

@RaghavAgrawal-TUL-Luxury
Copy link

RaghavAgrawal-TUL-Luxury commented Aug 12, 2024

Currently, on npm registry Enzyme@3.11.0 dependencies look like this:
Screenshot 2024-08-12 at 12 11 09 PM

This caret(^) symbol which is updating the cheerio version for all users is breaking for our application.

Thanks for reporting an issue to us! We're glad you are using and invested in Enzyme.
Before submitting, please read over our commonly reported issues to prevent duplicates!

All common issues

Notoriously common issues

If you haven't found any duplicated issues, please report it with your environment!

Current behavior

Expected behavior

Your environment

API

  • shallow
  • mount
  • render

Version

library version
enzyme
react
react-dom
react-test-renderer
adapter (below)

Adapter

  • enzyme-adapter-react-16
  • enzyme-adapter-react-16.3
  • enzyme-adapter-react-16.2
  • enzyme-adapter-react-16.1
  • enzyme-adapter-react-15
  • enzyme-adapter-react-15.4
  • enzyme-adapter-react-14
  • enzyme-adapter-react-13
  • enzyme-adapter-react-helper
  • others ( )
@RaghavAgrawal-TUL-Luxury
Copy link
Author

In the 'master' branch, the version of cheerio package is changed to "=1.0.0-rc.3", which is not updated in the npm registry, so publishing this change should fix the issue for older projects using node < 18.17.0.

@RaghavAgrawal-TUL-Luxury
Copy link
Author

Meanwhile, the solution for this is to add the following in package.json:

For yarn:
"resolutions": { "cheerio": "1.0.0-rc.3" }

For npm:
"overrides": { "cheerio": "1.0.0-rc.3" }

@ljharb
Copy link
Member

ljharb commented Aug 12, 2024

Duplicate of #2558.

@ljharb ljharb closed this as not planned Won't fix, can't repro, duplicate, stale Aug 12, 2024
@EJLearner
Copy link

Why was this closed as "not planned"? Will there no longer be any fixes for this library?

@ljharb
Copy link
Member

ljharb commented Aug 13, 2024

@EJLearner it wasn't, it was closed as a duplicate. See the issue it duplicates, which is fixed, and the next release of enzyme will include it.

On Github, issues are closed when the fix lands, not when the fix is published.

@hanamantk
Copy link

Meanwhile, the solution for this is to add the following in package.json:

For yarn: "resolutions": { "cheerio": "1.0.0-rc.3" }

For npm: "overrides": { "cheerio": "1.0.0-rc.3" }

@RaghavAgrawal-TUL-Luxury
But cheerio: 1..0.0.rc.3 (rc-release candidate not recommended for production so what is the fix for prod i dont want to upgrade node version so)

@ljharb
Copy link
Member

ljharb commented Aug 26, 2024

@hanamantk theres no other option, since rc3 is the last cheerio version that’s compatible with enzyme.

glepretre added a commit to Kozea/formol that referenced this issue Sep 3, 2024
cheerio (https://github.com/cheeriojs/cheerio) has release an official 1.0.0
version after years of Release Candidate ones.

cheeriojs/cheerio#4044
cheeriojs/cheerio#4032
cheeriojs/cheerio#3987

We depend on enzyme (https://github.com/enzymejs/enzyme) which depends
on cheerio.

Enzyme has not correctly locked cheerio RC version:
enzymejs/enzyme@cafdb2b

They're working on it...
enzymejs/enzyme#2558
enzymejs/enzyme#2606
enzymejs/enzyme#2607
enzymejs/enzyme#2608
enzymejs/enzyme#2609

Meanwhile, locking cheerio here allow us to update our dependencies.

According to enzyme, Cheerio RC was the last one supported by enzyme,
even though RC12 seems to work for us.
glepretre added a commit to Kozea/formol that referenced this issue Sep 3, 2024
cheerio (https://github.com/cheeriojs/cheerio) has released an official 1.0.0
version after years of Release Candidate ones.

cheeriojs/cheerio#4044
cheeriojs/cheerio#4032
cheeriojs/cheerio#3987

We depend on enzyme (https://github.com/enzymejs/enzyme) which depends
on cheerio.

Enzyme has not correctly locked cheerio RC version:
enzymejs/enzyme@cafdb2b

They're working on it...
enzymejs/enzyme#2558
enzymejs/enzyme#2606
enzymejs/enzyme#2607
enzymejs/enzyme#2608
enzymejs/enzyme#2609

Meanwhile, locking cheerio here allow us to update our dependencies.

According to enzyme, Cheerio RC was the last one supported by enzyme,
even though RC12 seems to work for us.
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

4 participants