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

Please remove cheerio / parse5 dependency as parse5 has gone rogue #1467

Closed
1 of 10 tasks
huntharo opened this issue Jan 9, 2018 · 1 comment
Closed
1 of 10 tasks

Comments

@huntharo
Copy link

huntharo commented Jan 9, 2018

Current behavior

Using Enzyme in React Native projects causes TypeScript builds to fail with error:

node_modules/@types/node/index.d.ts(138,13): error TS2300: Duplicate identifier 'require'.
node_modules/@types/react-native/index.d.ts(8598,14): error TS2300: Duplicate identifier 'require'.

Enzyme depends on Cheerio which depends on Parse5, and Parse5 lists @types/node as a runtime dependency that gets installed with the NPM package into consuming projects. @types/node conflicts with the types provided in React Native projects and possibly other project types.

Expected behavior

Parse5 does not even use TypeScript AT ALL so it shouldn't be including ANY @types packages.

Builds of React Native projects should work, not fail, when using TypeScript.

The fix is simple: either remove this @types dependency from parse5 or move it from a runtime dependency to a dev dependency as in the following pull request for parse5:

inikulin/parse5#226

Issue first reported to parse5 in November, 2017 and the active unhelpfulness of the maintainer to remove something that provides no benefit to them but actively hurts others is documented here:

inikulin/parse5#220

Please either remove the cheerio / parse5 dependencies, fork them with a fix, or get the maintainer of parse5 to fix this. Thanks!

Your environment

API

  • shallow
  • mount
  • render

Version

library version
Enzyme 3.2.0
React 16.0.0

Adapter

  • enzyme-adapter-react-16
  • enzyme-adapter-react-15
  • enzyme-adapter-react-15.4
  • enzyme-adapter-react-14
  • enzyme-adapter-react-13
  • enzyme-adapter-react-helper
  • others ( )
@ljharb
Copy link
Member

ljharb commented Jan 9, 2018

This isn’t the place to report this. Report it to Cheerio and to typescript (because typescript builds shouldn’t be so brittle as to fail in this scenario).

@ljharb ljharb closed this as completed Jan 9, 2018
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

2 participants