question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Jest: Got error running globalSetup - /[root]/node_modules/@storybook/test-runner/playwright/global-setup.js, reason: Class extends value #<Object> is not a constructor or null

See original GitHub issue

Describe the bug When trying test-storybook, we get the following error: TypeError: Jest: Got error running globalSetup - /[root]/node_modules/@storybook/test-runner/playwright/global-setup.js, reason: Class extends value #<Object> is not a constructor or null

the trace is:

    at Object.<anonymous> (/[root]/node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:242:27)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Object.newLoader (/[root]/node_modules/pirates/lib/index.js:141:7)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/[root]/node_modules/jest-playwright-preset/index.js:1:18)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Object.newLoader (/[root]/node_modules/pirates/lib/index.js:141:7)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)

To Reproduce Run ‘test-storybook’ to see the above error: Repository: https://github.com/ryanbuckleyca/sbbug Deployed repo: https://sbbug.herokuapp.com/

System (note, the same bug occurs in our development environment as well, so it is not specific to this system)

Environment Info:

System: OS: macOS 12.3.1 CPU: (8) x64 Intel® Core™ i7-8569U CPU @ 2.80GHz Binaries: Node: 14.15.5 - ~/.nvm/versions/node/v14.15.5/bin/node npm: 8.7.0 - ~/.nvm/versions/node/v14.15.5/bin/npm Browsers: Firefox: 99.0.1 Safari: 15.4 npmPackages: @storybook/addon-actions: ^6.5.0-beta.1 => 6.5.0-beta.1 @storybook/addon-docs: ^6.5.0-beta.1 => 6.5.0-beta.1 @storybook/addon-essentials: ^6.5.0-beta.1 => 6.5.0-beta.1 @storybook/addon-interactions: ^6.5.0-beta.1 => 6.5.0-beta.1 @storybook/addon-links: ^6.5.0-beta.1 => 6.5.0-beta.1 @storybook/builder-webpack4: ^6.5.0-beta.1 => 6.5.0-beta.1 @storybook/manager-webpack4: ^6.5.0-beta.1 => 6.5.0-beta.1 @storybook/react: ^6.5.0-beta.1 => 6.5.0-beta.1 @storybook/testing-library: ^0.0.11 => 0.0.11

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:9
  • Comments:5

github_iconTop GitHub Comments

3reactions
v1s10n-4commented, May 5, 2022

Looks like this issue is related to storybookjs/test-runner#99 According to this answer it can be fixed by matching some dependencies version needed by jest-playwright:

"jest": "^27.5.1",
"jest-runner": "^27.5.1",
"jest-environment-node": "27.5.1"
2reactions
tomasfranciscocommented, Oct 12, 2022

For me it also works with

"resolutions": { 
    "jest": "28.1.3",
    "jest-runner": "28.1.3",
    "jest-environment-node": "28.1.3"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Runtime error in jest - TypeError: Class extends value ...
The problem is explained in the documentation: A limitation with the factory parameter is that, since calls to jest.mock() are hoisted to ...
Read more >
Class extends value #<Object> is not a constructor or null
I built a proxy server with netlify function. It worked well at local development environment. But after deployment, this error occurred. I'm not...
Read more >
jest typeerror: class extends value - You.com | The AI Search ...
I get the following error: FAIL e2e/firstTest.e2e.jsrun... ○ Test suite failed to run TypeError: Class extends value #<Object> is not a constructor or...
Read more >
TypeError: Class extends value undefined is not a constructor ...
(This could take a while) ✖ Generating types → at Module._compile (node:internal/modules/cjs/loader:1095:14) Error: Command failed with exit ...
Read more >
Class extends value #<Object> is not a constructor or null ...
Hi there, can anyone help me to figure out what´s the issue with this error? I tried to upload a Node.js and Next.js...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found