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

Version 6.6.0 has incorrect imports for lodash/isEqualWith. #641

Closed
adriantrunzo opened this issue Oct 16, 2024 · 6 comments · Fixed by #642
Closed

Version 6.6.0 has incorrect imports for lodash/isEqualWith. #641

adriantrunzo opened this issue Oct 16, 2024 · 6 comments · Fixed by #642

Comments

@adriantrunzo
Copy link

  • @testing-library/jest-dom version: 6.6.0
  • node version: 20.17.0
  • jest (or vitest) version: vitest 2.1.2
  • npm (or yarn) version: pnpm 9.12

Relevant code or config:

The node_modules/@testing-library/jest-dom/dist/vitest.mjs file currently reads:

import { expect } from 'vitest';
import { e as extensions } from './matchers-12582698.mjs';
import 'redent';
import '@adobe/css-tools';
import 'dom-accessibility-api';
import 'aria-query';
import 'chalk';
import 'lodash/isEqualWith.js';
import 'css.escape';
import 'lodash/isEqualWith';

/* istanbul ignore file */


expect.extend(extensions);

All other dist files have the same problem.

Notice the two different imports of lodash/isEqualWith. The second one is incorrect and was added in #637 : https://github.com/testing-library/jest-dom/pull/637/files#diff-a136cc1088d17955bf3e51c2cb464c75890d15a5a008c05a9d17c68609b0a2f5R1.

See also: https://github.com/search?q=repo%3Atesting-library%2Fjest-dom%20lodash%2FisEqualWith&type=code

What you did:

Try to upgrade to 6.6.0.

What happened:

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 8 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Error: Cannot find module '/Users/.../node_modules/.pnpm/@testing-library+jest-dom@6.6.0/node_modules/lodash/isEqualWith' imported from /Users/.../node_modules/.pnpm/@testing-library+jest-dom@6.6.0/node_modules/@testing-library/jest-dom/dist/vitest.mjs
Did you mean to import "lodash/isEqualWith.js"?
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/8]

Reproduction:

Problem description:

Incorrect import.

Suggested solution:

Change the import of lodash/isEqualWith in src/to-have-selection.js

@gnapse
Copy link
Member

gnapse commented Oct 16, 2024

Hmmm, I wonder why wasn't this caught in the tests and CI checks. Anyway. Will fix it.

@gnapse
Copy link
Member

gnapse commented Oct 16, 2024

Wait, there's something weird going on here. We've had the same import for some time, in src/to-have-value.js.

import isEqualWith from 'lodash/isEqualWith.js'

Looking at the difference with the new one, the new one lacks the extension.

import isEqualWith from 'lodash/isEqualWith'

Ugh, I hate it with the extension is needed in imports. I wonder if that's why it worked in CI and not for you.

gnapse added a commit that referenced this issue Oct 16, 2024
jamesobrooks added a commit to US-Trustee-Program/Bankruptcy-Oversight-Support-Systems that referenced this issue Oct 16, 2024
@testing-library/jest-dom has an issue with an import in version 6.6.0.
testing-library/jest-dom#641
There is already a pull request to fix this, but for now we can unblock
by excluding this broken version.
@ddolcimascolo
Copy link
Contributor

Was coming here for this exact same issue :)

And I don't know if you're aware but this happened before so this might require an eslint rule or something.

Thanks for your work on this library!

Cheers,
David

@alamenai
Copy link

Same issue here, it started happening in the pipeline then I found it here.

@qeleb
Copy link

qeleb commented Oct 16, 2024

+1

@gnapse
Copy link
Member

gnapse commented Oct 16, 2024

The fix is now released in v6.6.1.

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

Successfully merging a pull request may close this issue.

5 participants