-
-
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]: Cannot read property 'bind' of undefined #12182
Comments
I've got the same after an update from jest version 27.4.3 |
I have the same issue running in jenkins pipeline(probably ubuntu) for both version ^27.0.6 and ^27.4.5, but works in my local mac. |
Please provide a reproduction we can run and see the error |
Again, a reproduction is needed |
I tried to reproduce the issue with minimum dependencies, but failed, everything works fine. And finally I found that my issue relates to mono repo as we use lerna. |
use yarn install instead of npm install solved my issue |
I am trying to identify the issue too. I am using jest in a npm@8 workspaces setup and I think the issue might be due to an update of a different package that depends on jest. I think one issue could be the resulting UPDATE: This is roughly my folder structure
The errors I get are from running tests inside the My /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
}; and the error: #20 16.75 FAIL src/utils/sanitization-utils.test.ts
#20 16.75 ● Test suite failed to run
#20 16.75
#20 16.75 TypeError: Cannot read property 'bind' of undefined
#20 16.75
#20 16.75 at Runtime._createJestObjectFor (../../node_modules/jest-runtime/build/index.js:2193:46)
#20 16.75 at async TestScheduler.scheduleTests (../../node_modules/@jest/core/build/TestScheduler.js:333:13)
#20 16.75 at async runJest (../../node_modules/@jest/core/build/runJest.js:404:19) |
I get this error with |
@laat it seems to be working if you update to latest jest. I've just tried that. updating to last version of jest (27.4.6) also fixed my issue. |
Yeah, fixed by #12213 |
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.5
Steps to reproduce
Just run a simple test with nothing in it:
Expected behavior
Not getting this error, and the test should work.
Actual behavior
Additional context
The error doesn't show up on 26.6.3. I'll use this version until the bug is fixed.
Probably related issue: #11720
Environment
The text was updated successfully, but these errors were encountered: