-
Notifications
You must be signed in to change notification settings - Fork 459
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 something. #2612
Comments
Getting the same error. sockethub/sockethub#429
Package versions:
|
duplicate #2611 |
Thank you for the feedback. It might be a good idea to keep one of the issues open so it's easy to find. That's why I thought it wasn't an issue anymore as it was closed. |
So which is the issue that's actually tracking this as both this and the linked one are closed? I've just upgraded to 27.0.1 and I'm getting this error |
pls clear Jest cache and use |
That worked, thank you! |
Thanks. Saved the day! |
Met the same issue with |
You have to use ts-jest 27.0.1 and clear jest cache @Jeff-Tian |
Also reverted, because I don't use ts-jest, but @angular-builders/jest. Will wait to switch to Angular 12 before updating this one. |
Still getting this issue even after clearing the jest cache and updating ts-jest to 27.0.1. |
You should clear Jest cache via |
I used this: |
adding 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. |
how about remove Please make sure that there are no other dependencies using |
btw, thank you so much for your quick replies and all your work with ts-jest! I already tried doing a clean install of |
@asohail-futu check the version of |
Thanks for the suggestion @sauldeleon but the issue still occurred while using jest v27 and no other dependency was using v26, as far as I could check. For now, I've reverted back to v26. |
@asohail-futu are you using react-scripts? in my case just check .lock file and see if any subdependant library is using jest 26. I had to use yarn I have also reverted to jest 26, but if you need jest 27 you can try that workarround |
v27 was causing some issues that don't seem to have an easy workaround yet: kulshekhar/ts-jest#2612
Running tests failed after updating jest to over 27.0.0 because of the issue described here: kulshekhar/ts-jest#2612 To fix this issue, we need to update js-test as well.
This is required to update Jest to 27.x. See: - kulshekhar/ts-jest#2612 (comment)
I don't want to use jest 27 due to we have in issue with raised memory usage in this version (#2696). Does it mean that backward compatibility is broken? |
there is never a compatibility support before. Major version of |
Ok, got it. It is hard to understand, because now I'm in situation when all pipelines is down, but ok. |
Not sure if it will help, but I had this issue because my version of jest globally differed from the version in the project I was working on. Running |
And this fix is leading to: Reference: jestjs/jest#11720 |
Reverting from Clearing cache and re-installing node modules did not. |
Dependabot Jest upgrade PR cause all tests to fail Manually do upgrade with fix for Jest tests: - 'ts-jest' version required upgrade: kulshekhar/ts-jest#2612 (comment) - Add 'testEnvironment' to Jest config: https://stackoverflow.com/questions/67373953/jest-fails-with-self-is-not-defined-when-importing-react-diagrams
Exactly the same here, clear cache, re-installing |
Clearing cache & reinstalling did not help me, but upgrading |
fixed by upgrading |
🐛 Bug Report
After upgrading from jest
23.6.3
to27.0.1
and running our test suite we get the following error message:To Reproduce
Expected behavior
No error message
Debug log:
envinfo
Related issue
The text was updated successfully, but these errors were encountered: