From f4067b2d8c7881b8222816c8663685549b01d3a5 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Thu, 25 Aug 2022 20:51:02 +0800 Subject: [PATCH] Handle findSourceMap returning null since Node.js 18.8.0 Co-authored-by: Mark Wubben --- lib/snapshot-manager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }