Skip to content

Commit 73cbc09

Browse files
committed
webpack hates optional chaining?
1 parent 81f7352 commit 73cbc09

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/node/src/stack-parser.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ function getModule(filename: string | undefined): string | undefined {
66
return;
77
}
88

9-
const base = `${(require?.main?.filename && dirname(require.main.filename)) || global.process.cwd()}/`;
9+
const base = `${
10+
(require && require.main && require.main.filename && dirname(require.main.filename)) || global.process.cwd()
11+
}/`;
1012

1113
// It's specifically a module
1214
const file = basename(filename, '.js');

0 commit comments

Comments
 (0)