TypeError: Jest: a transform must export something.
See original GitHub issue🐛 Bug Report
After upgrading from jest 23.6.3
to 27.0.1
and running our test suite we get the following error message:
TypeError: Jest: a transform must export something.
To Reproduce
- Clone the GIT repo
- Upgrade jest:
name range from to url
>( ) jest latest 26.6.3 ❯ 27.0.1 https://jestjs.io/
- Run yarn test
Expected behavior
No error message
Debug log:
# content of ts-jest.log :
{"context":{"allowJs":false,"logLevel":20,"namespace":"jest-preset","package":"ts-jest","version":"26.5.6"},"message":"creating jest presets not handling JavaScript files","sequence":1,"time":"2021-05-25T13:21:43.451Z"}
{"context":{"allowJs":false,"logLevel":20,"namespace":"jest-preset","package":"ts-jest","version":"26.5.6"},"message":"creating jest presets not handling JavaScript files","sequence":2,"time":"2021-05-25T13:21:43.474Z"}
{"context":{"logLevel":20,"namespace":"Importer","package":"ts-jest","version":"26.5.6"},"message":"creating Importer singleton","sequence":3,"time":"2021-05-25T13:21:45.906Z"}
envinfo
System:
OS: Windows Server 2016
Node version: 14.15.4
Npm packages:
jest: 27.0.1
ts-jest: 26.5.6
typescript: 4.2.4
Issue Analytics
- State:
- Created 2 years ago
- Reactions:47
- Comments:29
Top Results From Across the Web
TypeError: Jest: a transform must export something
I tried to debug Jest by Node debugger (something like node inspect test.js ) , and I found the culprit. For me it...
Read more >Code Transformation - Jest
Instead of having your custom transformer implement the Transformer interface directly, you can choose to export createTransformer , a factory ...
Read more >Error: Jest: A Transform Must Export A 'Process' Function. Stack
After upgrading from jest 23.6.3 to 27.0.1 and running our test suite we get the following error message: TypeError: Jest: a transform must...
Read more >TypeError: Jest: a transform must export a `process` function In ...
[Solved]-ERROR: Jest: a transform must export a `process` function. STACK: TypeError: Jest: a transform must export a `process` function In VUE Project-Vue.js.
Read more >Configuration | ts-jest - Huafu
ts-jest provides a helper to transform the mapping from tsconfig to Jest config format, but it needs the .js version of the config...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
pls clear Jest cache and use
ts-jest
27.0.0adding to the previous comment – clearing the cache didn’t solve the issue for me. I’m still getting the original error mentioned in this thread.