next.js
e3a07475 - Turbopack dev: evict stale edge module context on chunk rename

Commit
11 hours ago
Turbopack dev: evict stale edge module context on chunk rename When an edge entry (middleware or an edge API route) is edited, all of its content-hashed chunks are renamed. `clearRequireCache` only called `clearModuleContext` on the *new* chunk paths, but an edge module context is cached under a stable module name and is only evicted when a cleared path matches a chunk the live context already loaded. Since none of the new paths matched the stale context's old paths, it was never evicted and the previous handler kept serving (e.g. returning 200 instead of the expected unsupported Node.js module 500). Track each edge entry's previously written server paths and, on change, evict via the paths that were removed — exactly the ones the stale context loaded. Node.js entries are unaffected (they are re-required from their new path).
Author
Parents
Loading