Problem
I’ve been burning a lot of credits while hitting the same issue over an over regarding stale cache entries.
When a file is edited that contains a syntax error (e.g. an unclosed template literal), Turbopack correctly flags it. After the file is fixed — including full rewrites via the v0 Write tool producing a syntactically valid file — Turbopack continues to report the original error from the broken version, even though the file on disk is now correct.
The error persists across:
- Single-line edits to the fixed file
- Comment additions to force a re-parse
- Full file rewrites (
Writetool replacing the entire file contents)
The only observable behaviour is a blank preview pane with the stale error displayed in the diagnostics panel. The error resolves eventually (seemingly on its own) but not predictably, burning time and credits while we retry edits trying to “fix” a problem that is already fixed.
Steps to Reproduce
- Edit an API route to introduce a syntax error (e.g. an unclosed backtick in a template literal)
- Observe correct error in
Turbopack - Fix the file completely (full rewrite)
Turbopackcontinues reporting the original error for multiple subsequent builds- Adding trivial edits (comments, whitespace) to force re-parse does not resolve it
Expected Behavior
After a file is rewritten with valid syntax, Turbopack should clear the error on the next build.
Impact
Burning credits while distinguishing between “file is still broken” and “Turbopack has a stale cache entry”, leading to repeated unnecessary edits.