enzymejs / enzyme

JavaScript Testing utilities for React
https://enzymejs.github.io/enzyme/
MIT License
19.96k stars 2.01k forks source link

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

Closed ryanrd closed 2 years ago

ryanrd commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@vbhayden that is certainly another alternative.