diff --git a/lib/snapshot-manager.js b/lib/snapshot-manager.js index 3e3b4b89d..c0a8922ec 100644 --- a/lib/snapshot-manager.js +++ b/lib/snapshot-manager.js @@ -391,7 +391,9 @@ class Manager { const resolveSourceFile = mem(file => { const sourceMap = findSourceMap(file); - if (sourceMap === undefined) { + // Prior to Node.js 18.8.0, the value when a source map could not be found was `undefined`. + // This changed to `null` in . Check both. + if (sourceMap === undefined || sourceMap === null) { return file; }