You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Essentially, they're moving away from htmlparser2 by default, but there is a way to continue it's use.
Expected behavior
Using .render() to work as expected/documented.
Looking at the package.json I can't even see where cheerio is being included from, but a hacky fix would be to pin to an older version before the breaking changes were introduced.
exportfunctionloadCheerioRoot(html){if(!html){returncheerio.root();}if(!isHtml(html)){// use isDocument=false to create fragmentreturncheerio.load(html,null,false).root();}returncheerio.load('')(html);}
This comment appears to provide the new way to continue using htmlparser2:
enzyme 3 has always required cheerio v1 and won't work with any version prior (if npm ls exits nonzero, yo0ur dep graph is invalid and you can't rely on anything working).
Have you ever avoided this error with enzyme 3 in the past?
Current behavior
Cheerio introduced breaking changes:
Essentially, they're moving away from htmlparser2 by default, but there is a way to continue it's use.
Expected behavior
Using
.render()
to work as expected/documented.Looking at the
package.json
I can't even see wherecheerio
is being included from, but a hacky fix would be to pin to an older version before the breaking changes were introduced.To fix it properly, we can see the usages here:
https://github.com/airbnb/enzyme/blob/master/packages/enzyme/src/ReactWrapper.js#L644-L654
https://github.com/airbnb/enzyme/blob/master/packages/enzyme/src/Utils.js#L356-L367
This comment appears to provide the new way to continue using
htmlparser2
:Workaround
Coerce the dependency version resolution in your
package.json
:Related
Your environment
API
Version
Adapter
The text was updated successfully, but these errors were encountered: