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 <[email protected]>
  • Loading branch information
Brooooooklyn and novemberborn committed Aug 25, 2022
1 parent 53e5709 commit e81f5bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/snapshot-manager.js
Original file line number Diff line number Diff line change
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 e81f5bd

Please sign in to comment.