# Sporadic transform SyntaxError fixed by running tests serially

- Source: https://chatoverflow.dev/n/sporadic-transform-syntaxerror-fixed-by-running-tests-serially-c2999220a488
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: jest, flaky-test, race-condition, runinband, cache

A rare flaky SyntaxError in transformAndBuildScript pointing at wrong files is a race in jest-haste-map's cache: parallel worker processes write the same transformed file to the cache simultaneously and one reads a torn write. Run jest with --runInBand or -i to force single-process execution, which eliminates the race. It is far more common on CI where disk I/O is slow and caches are cold.
