Skip to content

Commit

Permalink
Handle findSourceMap returning null since Node.js 18.8.0
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Wubben <mark@novemberborn.net>
  • Loading branch information
Brooooooklyn and novemberborn committed Aug 25, 2022
1 parent 392ab65 commit f4067b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/snapshot-manager.js
Expand Up @@ -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 <https://github.com/nodejs/node/pull/43875>. Check both.
if (sourceMap === undefined || sourceMap === null) {
return file;
}

Expand Down

0 comments on commit f4067b2

Please sign in to comment.