You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
Describe the bug
The jest-playwright-preset package, when used in a playwright docker container, leads to TypeError: 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 whether jest-playwright-preset or the playwright Docker image is contributing to this behavior.
To Reproduce
Use this minimal Docker file:
FROM mcr.microsoft.com/playwright:v1.21.0-focal
WORKDIR /app
RUN npm install jest-playwright-preset
CMD node -e "const { globalSetup: playwrightGlobalSetup } = require('jest-playwright-preset')"
Build the image and run it: docker build -t app . && docker run --rm app
Expected behavior
The following error message appeared:
/app/node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:59
return class PlaywrightEnvironment extends RootEnv {
^
TypeError: Class extends value #<Object> is not a constructor or null
at Object.getPlaywrightEnv (/app/node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:59:48)
at Object.<anonymous> (/app/node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:242:27)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/app/node_modules/jest-playwright-preset/index.js:1:18)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
Desktop (please complete the following information):