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(
5656 }
5757 let { fileName } = frame ;
5858 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.
5963 fileName = path . normalize ( fileName . replace ( / [ \\ ] + / g, '/' ) ) ;
6064 }
6165 if ( fileName == null ) {
@@ -64,6 +68,7 @@ async function unmap(
6468 const fN : string = fileName ;
6569 const source = map
6670 . getSources ( )
71+ // Prepare path for normalization; see comment above for reasoning.
6772 . map ( s => s . replace ( / [ \\ ] + / g, '/' ) )
6873 . filter ( p => {
6974 p = path . normalize ( p ) ;
You can’t perform that action at this time.
0 commit comments