Skip to content

Commit 19eadc2

Browse files
committed
Make sure it's an absolute path
1 parent 8997f58 commit 19eadc2

File tree

1 file changed

+1
-1
lines changed
  • packages/react-error-overlay/src/components

1 file changed

+1
-1
lines changed

packages/react-error-overlay/src/components/frame.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function createFrame(
149149
let url;
150150
if (!compiled && sourceFileName && sourceLineNumber) {
151151
// Remove everything up to the first /src/
152-
const trimMatch = /.*?[/|\\](src[/|\\].*)/.exec(sourceFileName);
152+
const trimMatch = /^[/|\\].*?[/|\\](src[/|\\].*)/.exec(sourceFileName);
153153
if (trimMatch && trimMatch[1]) sourceFileName = trimMatch[1];
154154

155155
url = sourceFileName + ':' + sourceLineNumber;

0 commit comments

Comments
 (0)