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-rc.11 no longer support deep imports #2558

Closed
ryanrd opened this issue May 20, 2022 · 3 comments
Closed

Cheerio 1.0.0-rc.11 no longer support deep imports #2558

ryanrd opened this issue May 20, 2022 · 3 comments

Comments

@ryanrd
Copy link

ryanrd commented May 20, 2022

Current behavior

Cannot find module 'cheerio/lib/utils' from 'node_modules/enzyme/build/Utils.js'

packages/enzyme/src/Utils.js

import { isHtml } from 'cheerio/lib/utils';

Expected behavior

no error

API

Version

library version
enzyme latest

Adapter

N/A

@ljharb
Copy link
Member

ljharb commented May 20, 2022

You're right; the next release of enzyme pegs cheerio to 1.0.0-rc.3 - you can peg this yourself in the meantime in your package.json.

@vbhayden
Copy link

Why not just add the little isHtml function into the enzyme file that's trying to import it? It's all of 8 lines and would save the dependency pegging.

@ljharb
Copy link
Member

ljharb commented Jun 24, 2022

@vbhayden that is certainly another alternative.

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.
zzacharo added a commit to anikachurilova/react-searchkit that referenced this issue Oct 10, 2024
* Add TextEncoder, TextDecoder, ReadableStream as globals
  due to jsdom/jsdom#2524
* Pin `cheerio` due to enzymejs/enzyme#2558
* Add option `--transformIgnorePatterns /\"node_modules/(?!axios)/\"`
  to instruct jest to transform  "node_modules/axios"
zzacharo added a commit to anikachurilova/react-searchkit that referenced this issue Oct 10, 2024
* Add TextEncoder, TextDecoder, ReadableStream as globals
  due to jsdom/jsdom#2524
* Pin `cheerio` due to enzymejs/enzyme#2558
* Add option `--transformIgnorePatterns /\"node_modules/(?!axios)/\"`
  to instruct jest to transform  "node_modules/axios"
zzacharo added a commit to anikachurilova/react-searchkit that referenced this issue Oct 10, 2024
* Add TextEncoder, TextDecoder, ReadableStream as globals
  due to jsdom/jsdom#2524
* Pin `cheerio` due to enzymejs/enzyme#2558
* Add option `--transformIgnorePatterns /\"node_modules/(?!axios)/\"`
  to instruct jest to transform  "node_modules/axios"
zzacharo added a commit to inveniosoftware/react-searchkit that referenced this issue Oct 10, 2024
* Add TextEncoder, TextDecoder, ReadableStream as globals
  due to jsdom/jsdom#2524
* Pin `cheerio` due to enzymejs/enzyme#2558
* Add option `--transformIgnorePatterns /\"node_modules/(?!axios)/\"`
  to instruct jest to transform  "node_modules/axios"
grubbins pushed a commit to imc-trading/mattermost-plugin-pingboard that referenced this issue Oct 17, 2024
A workaround is needed to provide ReadableStream
since node 16 does not globally provide it.

A pin on the cheerio version was also needed
(enzymejs/enzyme#2558).
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

3 participants