Skip to content
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

Storyshot tests failing: TypeError: Super expression must either be null or a function #17620

Closed
kmurgic opened this issue Mar 3, 2022 · 1 comment

Comments

@kmurgic
Copy link

kmurgic commented Mar 3, 2022

Describe the bug
When running storyshoot tests using the @storybook/addon-storyshots addon I am getting the error message "TypeError: Super expression must either be null or a function"

To Reproduce
Reproduced here: https://github.com/kmurgic/storyshots-super-expression-failure

  1. Clone the repository: git clone https://github.com/kmurgic/storyshots-super-expression-failure.git
  2. Install dependenciesnpm i
  3. Run storybook and see that it is working as expected npm run storybook
  4. Run storyshot tests npm test

Expected

The tests run without issue 🥳

Actual

The tests fail with the error message TypeError: Super expression must either be null or a function

System
Environment Info:

System:
OS: Linux 5.4 Ubuntu 20.04.4 LTS (Focal Fossa)
CPU: (12) x64 Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
Binaries:
Node: 14.15.1 - ~/.nvm/versions/node/v14.15.1/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v14.15.1/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v14.15.1/bin/npm
Browsers:
Chrome: 99.0.4844.51
Firefox: 97.0
npmPackages:
@storybook/addon-essentials: ^6.4.19 => 6.4.19
@storybook/addon-storyshots: ^6.4.19 => 6.4.19
@storybook/addons: ^6.4.19 => 6.4.19
@storybook/react: ^6.4.19 => 6.4.19

Additional context
This was not working for me in a larger repo, created the new repo as a minimal reproduction.

@kmurgic
Copy link
Author

kmurgic commented Mar 10, 2022

Closing the issue was having moduleDirectories: ['node_modules', './'], in my jest config. Removing this fixed the issue.

@kmurgic kmurgic closed this as completed Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant