Skip to content

Commit 9e733b5

Browse files
committed
Internal Webpack paths should not be clickable
1 parent 172264e commit 9e733b5

File tree

1 file changed

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

1 file changed

+14
-8
lines changed

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

+14-8
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,20 @@ function createFrame(
267267

268268
let onSourceClick = null;
269269
if (sourceFileName) {
270-
onSourceClick = () => {
271-
fetch(
272-
'/__open-stack-frame-in-editor?fileName=' +
273-
window.encodeURIComponent(sourceFileName) +
274-
'&lineNumber=' +
275-
window.encodeURIComponent(sourceLineNumber || 1)
276-
).then(() => {}, () => {});
277-
};
270+
// e.g. "/path-to-my-app/webpack/bootstrap eaddeb46b67d75e4dfc1"
271+
const isInternalWebpackBootstrapCode = sourceFileName
272+
.trim()
273+
.indexOf(' ') !== -1;
274+
if (!isInternalWebpackBootstrapCode) {
275+
onSourceClick = () => {
276+
fetch(
277+
'/__open-stack-frame-in-editor?fileName=' +
278+
window.encodeURIComponent(sourceFileName) +
279+
'&lineNumber=' +
280+
window.encodeURIComponent(sourceLineNumber || 1)
281+
).then(() => {}, () => {});
282+
};
283+
}
278284
}
279285

280286
const elem = frameDiv(

0 commit comments

Comments
 (0)