jest: Jest fails all the time due to "Failed to cache transform results" on Windows
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Most of my calls to jest.runCLI
(I run jest
from a gulpfile
) end up with the following error:
jest: failed to cache transform results at ...
for random files. The stack shows a crashed fs.openSync
at the top. This is happening to me on Windows 7 Enterprise (64-bit) and not to my colleagues using MacOS. Sometimes it happens once, sometimes it’s many consecutive runs. I checked that it’s not caused by too long file paths (it’s pretty close though).
Funny thing is, this happens even when I run jest --no-cache
directly from the command-line.
What is the expected behavior?
If there’s a problem with caching, Jest should maybe warn about it, but recover and complete the test without the cache.
The current behavior means I have to remove jest
from the dev build, so that I can build reliably, which sucks.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
OS: Windows 7 Enterprise 64-bit (SP1) Node: 7.4.0 Npm: 4.0.5 Jest: 19.0.2
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 16
- Comments: 34 (5 by maintainers)
Commits related to this issue
- test: add a "testURL" field to jest config (#2082) fixes the " SecurityError: localStorage is not available for opaque origins" error message that everyone seems to get on their PRs. Using the s... — committed to vuematerial/vue-material by hissalht 5 years ago
- Feature: docs and landing page restyle (#2143) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test: add ... — committed to vuematerial/vue-material by marqbeniamin 5 years ago
- fix/footer-links (#2146) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test: add a "testURL" field to j... — committed to vuematerial/vue-material by dragosct 5 years ago
- Docs Restyle (#2151) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test: add a "testURL" field to jest ... — committed to vuematerial/vue-material by dragosct 5 years ago
- Added tag manager (#2154) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test: add a "testURL" field to ... — committed to vuematerial/vue-material by marqbeniamin 5 years ago
- v1.0.0-beta-12 (#2199) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test: add a "testURL" field to jes... — committed to vuematerial/vue-material by dragosct 4 years ago
- v1.0.0-beta-13 (#2208) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test: add a "testURL" field to jes... — committed to vuematerial/vue-material by dragosct 4 years ago
- v1.0.0-beta-14 (#2223) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test: add a "testURL" field to jes... — committed to vuematerial/vue-material by dragosct 4 years ago
- feat: active theme section move to navbar + code fund re-style (#2225) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add... — committed to vuematerial/vue-material by dragosct 4 years ago
- refactor: active theme disabled on main page (#2227) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test... — committed to vuematerial/vue-material by dragosct 4 years ago
- feat: add contributors (#2235) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test: add a "testURL" fiel... — committed to vuematerial/vue-material by dragosct 4 years ago
- faet: readme backers button (#2238) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test: add a "testURL"... — committed to vuematerial/vue-material by dragosct 4 years ago
- v1.0.0-beta-15 (#2257) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test: add a "testURL" field to jes... — committed to vuematerial/vue-material by marqbeniamin 4 years ago
- Refactor/change ads (#2263) (#2264) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test: add a "testURL"... — committed to vuematerial/vue-material by marqbeniamin 4 years ago
- fix: carbon ads (#2266) * fix(MdRadio): internal radio not being checked (#2063) * fix(MdMenu): unexpected close on item click (#2062) * docs: add funding * test: add a "testURL" field to je... — committed to vuematerial/vue-material by dragosct 4 years ago
This is happening to me as well on Windows 7 with
jest@21.1.0
,--runInBand
resolves it but that makes it run significantly slower. There should be an actual solution to this.i’ll create a new ticket
This is still an issue. I have my jest version set to “x” (meaning: always latest and greatest), my CI server does a
git clean -fdx
andnpm install
before build (and there is no package-lock.json in the project) and I still see stuff like this:(cache file went away?)
or this:
(cache file still being generated?)
The caching mechanism needs to cater for this and other issues – if it can’t read the file it expects to, simply regenerate it with a new id. Which is worse: a small slowdown because a race condition made a cache file go away, or an entire build failing sporadically because of cache misses?
Reinstall node_modules and it should be fine
Hello. Short note.
For me problems with “Failed to cache transform results” stops when I added
--runInBand
flag. (Win7)Same issue here. Fixed it by updating all Jest dependencies to latest versions:
I think we need to reopen this issue, I can still see the same error.
--runInBand
will resolve it but it is really too slow.I’m running into this issue on Windows 7 with Jest 24.0.0.
Getting this issue on node v8.9.4 and npm v5.6.0 in typescript. Got it to work by running jest with
-i
switch.Likely dup of https://github.com/facebook/jest/issues/4444
--runInBand
works for me but i dont want to run in band…windows 10 node 8.4.0 npm 5.3.0 jest 21.0.2 babel-jest 21.0.2
I haven’t had time to upgrade Node and test with the new Jest, but after the quite long time of the problem happening often, now suddenly it doesn’t anymore. So I’ll close for now and reopen with more details if it starts happening again.