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

TypeError: Jest: a transform must export a process function #77

Closed
jeremyzilar opened this issue Mar 10, 2022 · 1 comment
Closed

TypeError: Jest: a transform must export a process function #77

jeremyzilar opened this issue Mar 10, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jeremyzilar
Copy link

jeremyzilar commented Mar 10, 2022

👋 I am trying to add test-runner to an existing project that already has Storybook and Jest running, when following the Getting started instructions, I end up with the following error for each of my existing stories:

 FAIL   browser: chromium  spec/storybook/pages/request/index.stories.tsx
  ● Test suite failed to run

    TypeError: Jest: a transform must export a `process` function.

      at ScriptTransformer._getTransformer (node_modules/@jest/transform/build/ScriptTransformer.js:360:13)
      at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:427:28)
      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:569:40)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:607:25)
      at interopRequireDefault (node_modules/@storybook/core-common/dist/cjs/utils/interpret-require.js:64:16)

Steps to reproduce

  1. run yarn storybook in terminal, wait for it to finish
  2. run yarn test-storybook in another terminal

Current packages

  • My major versions of ts-jest and jest match.
  • I am using Webpack 4

Any thoughts on this?

@jeremyzilar jeremyzilar added the bug Something isn't working label Mar 10, 2022
@jeremyzilar
Copy link
Author

FYI, this seemed to solve it kulshekhar/ts-jest#2612 (comment)
Updating react-scripts fixed it. It was importing an older version dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant