File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
packages/react-error-overlay/src/utils Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ async function unmap(
56
56
}
57
57
let { fileName } = frame ;
58
58
if ( fileName ) {
59
+ // The web version of this module only provides POSIX support, so Windows
60
+ // paths like C:\foo\\baz\..\\bar\ cannot be normalized.
61
+ // A simple solution to this is to replace all `\` with `/`, then
62
+ // normalize afterwards.
59
63
fileName = path . normalize ( fileName . replace ( / [ \\ ] + / g, '/' ) ) ;
60
64
}
61
65
if ( fileName == null ) {
@@ -64,6 +68,7 @@ async function unmap(
64
68
const fN : string = fileName ;
65
69
const source = map
66
70
. getSources ( )
71
+ // Prepare path for normalization; see comment above for reasoning.
67
72
. map ( s => s . replace ( / [ \\ ] + / g, '/' ) )
68
73
. filter ( p => {
69
74
p = path . normalize ( p ) ;
You can’t perform that action at this time.
0 commit comments