-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Bug]: 27.4.0 TypeScript typechecking fails for @types/jsdom
when run without DOM lib
#12098
Comments
One possible dependency chain: |
@types/jsdom
when run without DOM lib
@DanielMSchmidt, I suspect your typechecking fails because you only pinned That's a minimal example, so you may need to pin other Jest-related deps... |
Temporary work around I applied in the mentioned PR above that will work for Yarn users that also do not even need JSDom (i.e. you only need Node environment), you can add this to your package.json: {
"resolutions": {
"jest-environment-jsdom": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.3.tgz"
},
} It's something I made long ago to force skip pesky dependencies that thankfully works in this case. |
@favna That work around only works for node version >= 14.18.0.
|
@Zheoden My bad, change the URL to 1.1.3 and you won't get that anymore. That was still a leftover from some bad Renovate Bot config I had a few months ago. I now changed it to |
Add |
This is necessary because Jest transitively depends on jsdom, which won't compile without DOM types ambiently available. See jestjs/jest#12098
Worked with pnpm also, thanks. |
DefinitelyTyped/DefinitelyTyped#57432 should solve it. If they don't accept it we can revert here |
I think this makes sense for Thanks @SimenB |
To clarify, I don't think |
|
Is their any solution for npm users? |
it's not actually needed but this bug got introduced with jest 27.4: jestjs/jest#12098
You can try using https://www.npmjs.com/package/npm-force-resolutions |
I temporarily downgraded to |
Please give https://github.com/facebook/jest/releases/tag/v27.4.3 a whirl |
* chore(release): Bump version * chore(release): Update changelog * Install all npm packges at once * chore(deps): Try pinning jest as mentioned in jestjs/jest#12098 (comment) * Drop ts-jest * Build tsc * tsc * . * evert "." This reverts commit 1068326. * tsconfig * Does it make a difference? * Revert "tsconfig" This reverts commit 1789f3d. * Revert "tsc" This reverts commit 2092129. * Revert "Build tsc" This reverts commit c956aef. * Revert "Drop ts-jest" This reverts commit dfa0a97. * set node options on windows as well * Update changelog * Make sure release jobs have similar memory settings /cc @jsteinich * jest fix Co-authored-by: Daniel Schmidt <[email protected]>
|
This is a better solution to #949. See jestjs/jest#12098 (comment).
it's not actually needed but this bug got introduced with jest 27.4: jestjs/jest#12098
it's not actually needed but this bug got introduced with jest 27.4: jestjs/jest#12098
Closes #1264 Issue has been fixed upstream in [email protected] (ref: jestjs/jest#12098) --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
27.4.0
Steps to reproduce
See repo at https://github.com/ryanvanoss/jest-27.4-types:
Expected behavior
Typechecking should succeed
Actual behavior
Typechecking fails due to missing DOM types:
Click to view failiures
Additional context
No response
Environment
For the
main
branch:For the
jest-27.4
branch:For the
jest-27.4-with-DOM
branch:The text was updated successfully, but these errors were encountered: