Skip to content

Commit e598c30

Browse files
committed
Detect whether error source is on a different drive (on Windows)
1 parent fb0c536 commit e598c30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/serialize-error.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ function buildSource(source) {
3939
const file = path.resolve(projectDir, source.file.trim());
4040
const rel = path.relative(projectDir, file);
4141

42-
const isWithinProject = rel.split(path.sep)[0] !== '..';
42+
const [segment] = rel.split(path.sep);
43+
const isWithinProject = segment !== '..' && (process.platform !== 'win32' || !segment.includes(':'));
4344
const isDependency = isWithinProject && path.dirname(rel).split(path.sep).includes('node_modules');
4445

4546
return {

0 commit comments

Comments
 (0)