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 1.0.0 is incompatible with enzyme 3.11.0. #3987

Closed
miskatonicfilm opened this issue Aug 9, 2024 · 1 comment
Closed

Cheerio 1.0.0 is incompatible with enzyme 3.11.0. #3987

miskatonicfilm opened this issue Aug 9, 2024 · 1 comment

Comments

@miskatonicfilm
Copy link

Due to the massive changes between release candidate 12 and version 1.0.0, enzyme 3.11.0 no longer works.

When running tests, the following error occurs:

Cannot find module 'node:stream' from 'node_modules/parse5-parser-stream/dist/cjs/index.js'

Require stack:

  node_modules/parse5-parser-stream/dist/cjs/index.js

  node_modules/cheerio/dist/commonjs/index.js

  node_modules/enzyme/build/Utils.js

  node_modules/enzyme/build/ReactWrapper.js

  node_modules/enzyme/build/index.js

  [src/setupTests.js](https://bitbucket.org/clearcaptions/dms-frontend/src/ec34279508e934b12f4d623fd2c0f332d0c787b1/src/setupTests.js)


> 1 | import { configure } from 'enzyme';

    | ^

  2 | import Adapter from 'enzyme-adapter-react-16';

  3 |

  4 | configure({ adapter: new Adapter() });
@fb55
Copy link
Member

fb55 commented Aug 10, 2024

That error is related to your node version or bundler. Cheerio now requires Node 18, and bundlers have to make sure to pick up to "browser" condition (which web bundlers should do anyway).

@fb55 fb55 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 10, 2024
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
Development

No branches or pull requests

2 participants