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

@types/react-dom incorrectly declared as a devDependency #1000

Closed
fmeum opened this issue Dec 3, 2021 · 2 comments · Fixed by #1001
Closed

@types/react-dom incorrectly declared as a devDependency #1000

fmeum opened this issue Dec 3, 2021 · 2 comments · Fixed by #1001

Comments

@fmeum
Copy link
Contributor

fmeum commented Dec 3, 2021

  • @testing-library/react version: v12.1.2
  • Testing Framework and version: N/A
  • DOM Environment: N/A

What you did:

Tried to use @testing-library/react in a TS web app built with Bazel's rules_nodejs, which enforce strict visibility between NPM packages as determined by their declared dependencies.

What happened:

Got the following tsc error when compiling a test that uses @testing-library/react with rules_nodejs:

node_modules/@testing-library/react/types/index.d.ts(9,24): error
TS2307: Cannot find module 'react-dom' or its corresponding type
declarations.
node_modules/@testing-library/react/types/index.d.ts(10,31): error
TS2307: Cannot find module 'react-dom/test-utils' or its corresponding
type declarations.

Problem description:

@testing-library/react declares @types/react-dom as a devDependency, but uses it in its external interface when used from TypeScript.

Suggested solution:

Mark @types/react-dom as a regular dependency of @testing-library/react so that packages depending on @testing-library/react also pick up this dependency.

@github-actions
Copy link

🎉 This issue has been resolved in version 12.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This issue has been resolved in version 13.0.0-alpha.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant