-
Notifications
You must be signed in to change notification settings - Fork 72
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] Peer dependency version crashes test-runner #203
Comments
Hey @t4ckermann thanks for opening this issue. In v.0.7.0 I made a release that should have made the test-runner use a self-contained Jest, which should not cause this issue anymore. I'll have to investigate. In the meantime, please use v0.6.4 as a workaround. |
I have the exact same issue on v0.9.0 on projects that use jest v27 (and have it listed as a dev dep). (on any version past 0.6.4) |
So I found a workaround to the issue, as well as a potential explanation. In my setup, I had create-react-app ( The issue:
The fix:To fix this, all it takes is for you to make sure that npm install -D jest@28 This will hoist and fix the issue. If you want the hoisting to be persisted in the lockfile but not have to keep jest@28 as a dependency in your project, you can optionally run this additional step after: npm uninstall -D jest Which will remove it from package.json, but the lockfile will still persist that Hope this helps! |
Hey peeps! I believe this issue has been fixed for quite a while now, so I'll be closing this. Feel free to open if you're still facing it! |
Describe the bug
When I try to run the test-runner I get the error mentioned in this bug report: storybookjs/storybook#18120
It seems like the problem is with the test-runner requiring "jest": "^28.0.0".
Maybe the Verison can be downgraded to 27.5.1?
Steps to reproduce the behavior
Have a working storybook instance with @storybook/test-runner.
Start the storybook.
Try to execute the following command on a new terminal:
npm run test-storybook --eject
Expected behavior
Can run tests on storybook.
Screenshots and/or logs
TypeError: Jest: Got error running globalSetup - path_to_project/node_modules/@storybook/test-runner/playwright/global-setup.js, reason: Class extends value undefined is not a constructor or null at getPlaywrightEnv (path_to_project/node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:59:5) at Object.<anonymous> (path_to_project/node_modules/jest-playwright-preset/lib/PlaywrightEnvironment.js:245:48) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Object.newLoader (path_to_project/node_modules/pirates/lib/index.js:141:7) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:93:18) at Object.<anonymous> (path_to_project/node_modules/jest-playwright-preset/index.js:1:18)
Environment
Additional context
These are my dependencies:
"dependencies": { "@material/theme": "^14.0.0", "@smui/checkbox": "^6.1.0", "@smui/form-field": "^6.1.0", "@storybook/preset-scss": "^1.0.3", "@storybook/test-runner": "^0.8.0", "svelte-preprocess": "^4.10.6", "@babel/core": "^7.17.8", "@babel/preset-env": "^7.16.11", "@rollup/plugin-node-resolve": "^6.0.0", "@smui/list": "^6.1.0", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-links": "^6.5.12", "@storybook/addons": "^6.5.12", "@storybook/svelte": "^6.5.12", "@testing-library/jest-dom": "^5.16.3", "@testing-library/svelte": "^3.1.0", "babel-jest": "^25.2.6", "babel-loader": "^8.2.4", "del-cli": "^3.0.0", "html-webpack-plugin": "^5.5.0", "jest": "27.5.1", "jest-runner": "27.5.1", "jest-environment-node": "27.5.1", "jest-config": "27.5.1", "rollup": "^1.20.0", "rollup-plugin-svelte": "^7.1.0", "rollup-plugin-terser": "^7.0.2", "sass": "^1.50.1", "sass-loader": "^8.0.2", "svelte": "^3.49.0", "svelte-jester": "^1.8.2", "svelte-loader": "^2.13.6", "typescript": "^4.6.4", "webpack": "^4.46.0" },
The text was updated successfully, but these errors were encountered: