Skip to content

Commit e81f5bd

Browse files
Handle findSourceMap returning null since Node.js 18.8.0
Co-authored-by: Mark Wubben <[email protected]>
1 parent 53e5709 commit e81f5bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/snapshot-manager.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ class Manager {
391391

392392
const resolveSourceFile = mem(file => {
393393
const sourceMap = findSourceMap(file);
394-
if (sourceMap === undefined) {
394+
// Prior to Node.js 18.8.0, the value when a source map could not be found was `undefined`.
395+
// This changed to `null` in <https://github.com/nodejs/node/pull/43875>. Check both.
396+
if (sourceMap === undefined || sourceMap === null) {
395397
return file;
396398
}
397399

0 commit comments

Comments
 (0)