Closed lifan0127 closed 2 years ago
We're experiencing the same issue:
TypeError: Jest: Got error running globalSetup - /tmp/storybook-e2e-testing/angular_modern_inline_rendering/node_modules/@storybook/test-runner/playwright/global-setup.js,
reason: Class extends value #<Object> is not a constructor or null
at Object.getPlaywrightEnv (/tmp/storybook-e2e-testing/angular_modern_inline_rendering/node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:59:5)
at Object.<anonymous> (/tmp/storybook-e2e-testing/angular_modern_inline_rendering/node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:242:27)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Object.newLoader (/tmp/storybook-e2e-testing/angular_modern_inline_rendering/node_modules/pirates/lib/index.js:141:7)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/tmp/storybook-e2e-testing/angular_modern_inline_rendering/node_modules/jest-playwright-preset/index.js:1:18)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Object.newLoader (/tmp/storybook-e2e-testing/angular_modern_inline_rendering/node_modules/pirates/lib/index.js:141:7)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
I wonder if this is related to the release of Jest 28?
Hi @yannbf, thanks for your reply! I am at least temporarily back in business by specifying v27 for jest
, jest-runner
, and jest-environment-node
.
"jest": "^27.5.1",
"jest-runner": "^27.5.1",
"jest-environment-node": "27.5.1"
It seems like the peerDependencies range should be locked down to < 28 for now until an update is made to support 28. https://github.com/playwright-community/jest-playwright/blob/c536b17fc391c272d9493f7e57bf19bfd223c264/package.json#L55-L58
@mmarkelov @mxschmitt it seems that the jest-playwright runner is broken right now due to Jest 28 being released. Do either of you have a little time to look into this? This package is used by @storybook/test-runner, which cannot move over to the playwright runner directly. Any help or guidance would be much appreciated!
Should be fixed in https://github.com/playwright-community/jest-playwright/pull/799 and a bugfix release gets released shortly.
Describe the bug The
jest-playwright-preset
package, when used in a playwright docker container, leads toTypeError: Class extends value #<Object> is not a constructor or null
. It started to happen to me yesterday as all my CI tests are failing due to this error. I am not sure whetherjest-playwright-preset
or the playwright Docker image is contributing to this behavior.To Reproduce Use this minimal Docker file:
Build the image and run it:
docker build -t app . && docker run --rm app
Expected behavior The following error message appeared:
Desktop (please complete the following information):