Skip to content

Commit 4bae90d

Browse files
committed
Fix regression
1 parent 8dfb007 commit 4bae90d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/react-error-overlay/src/utils/unmapper.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@ async function unmap(
4747
const fN: string = fileName;
4848
const source = map
4949
.getSources()
50-
.map(s => path.normalize(s.replace(/[\\]+/g, '/')))
50+
.map(s => s.replace(/[\\]+/g, '/'))
5151
.filter(p => {
52+
p = path.normalize(p);
5253
const i = p.lastIndexOf(fN);
5354
return i !== -1 && i === p.length - fN.length;
5455
})
5556
.map(p => ({
5657
token: p,
57-
seps: count(path.sep, p),
58+
seps: count(path.sep, path.normalize(p)),
5859
penalties: count('node_modules', p) + count('~', p),
5960
}))
6061
.sort((a, b) => {

0 commit comments

Comments
 (0)