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

6.1.0 failing on "Cannot find module '@testing-library/jest-dom'" #522

Closed
andrewbusch7 opened this issue Aug 23, 2023 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@andrewbusch7
Copy link

andrewbusch7 commented Aug 23, 2023

  • @testing-library/jest-dom version: 6.1.0
  • node version: v18.13.0
  • npm version: 8.19.3

Relevant code or config:

File src/setupTests.js

import "@testing-library/jest-dom";

What you did:

I upgraded from 6.0.1 to 6.1.0. Rollback to 6.0.1 fixes it.

What happened:

npm run tests now returns a failure on every test:

Cannot find module '@testing-library/jest-dom' from 'src/setupTests.js' for every test run

Reproduction:

If the root cause isn't obvious, I can work on a repo with a replicable example.

Problem description:

Fails always on current version.

Suggested solution:

My guess is something in 61d17bd broke things.

@CrOrc
Copy link

CrOrc commented Aug 23, 2023

In package.json
there a lines

  "main": "dist/cjs/index.js",
  "module": "dist/esm/index.js",

These files are not in package

@SteKoe
Copy link
Contributor

SteKoe commented Aug 23, 2023

I have fixed this in PR #523

@meza
Copy link

meza commented Aug 23, 2023

There's a great package: https://publint.dev/ that can lint the package json for proper hybrid settings!
Might be worth adding it to them mix

@crs1138
Copy link

crs1138 commented Aug 23, 2023

I believe the problem is actually with the new version of the @adobe/css-tools package. I've submitted a PR with them: adobe/css-tools#183

@nickserv
Copy link
Member

Can someone who's had this issue please verify if it's working or still erroring with jest-dom 6.1.2? We've fixed all our ESM publishing issues as far as I'm aware, so it could be adobe/css-tools#183.

@nickserv nickserv added bug Something isn't working needs discussion We need to discuss this to come up with a good solution labels Aug 24, 2023
@andrewbusch7
Copy link
Author

Yep working for me too, thanks all!

@nickserv nickserv removed the needs discussion We need to discuss this to come up with a good solution label Aug 24, 2023
@crs1138
Copy link

crs1138 commented Aug 25, 2023

Can someone who's had this issue please verify if it's working or still erroring with jest-dom 6.1.2? We've fixed all our ESM publishing issues as far as I'm aware, so it could be adobe/css-tools#183.

The v6.1.2 fixed it for me. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants