Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
8a72a314
Commit
8a72a314
authored
7 years ago
by
Jared Palmer
Committed by
Dan Abramov
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Make error overlay filename configurable (#3028)
* Make error overlay file configurable * Add fallback filename
parent
6644054f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
packages/react-dev-utils/webpackHotDevClient.js
+1
-0
packages/react-dev-utils/webpackHotDevClient.js
packages/react-error-overlay/src/index.js
+2
-1
packages/react-error-overlay/src/index.js
packages/react-error-overlay/src/listenToRuntimeErrors.js
+5
-2
packages/react-error-overlay/src/listenToRuntimeErrors.js
with
8 additions
and
3 deletions
+8
-3
packages/react-dev-utils/webpackHotDevClient.js
+
1
-
0
View file @
8a72a314
...
...
@@ -33,6 +33,7 @@ ErrorOverlay.startReportingRuntimeErrors({
module
.
hot
.
decline
();
}
},
filename
:
'
static/js/bundle.js
'
,
});
if
(
module
.
hot
&&
typeof
module
.
hot
.
dispose
===
'
function
'
)
{
...
...
This diff is collapsed.
Click to expand it.
packages/react-error-overlay/src/index.js
+
2
-
1
View file @
8a72a314
...
...
@@ -21,6 +21,7 @@ import type { ErrorRecord } from './listenToRuntimeErrors';
type
RuntimeReportingOptions
=
{
|
onError
:
()
=>
void
,
launchEditorEndpoint
:
string
,
filename
?:
string
,
|
};
let
iframe
:
null
|
HTMLIFrameElement
=
null
;
...
...
@@ -55,7 +56,7 @@ export function startReportingRuntimeErrors(options: RuntimeReportingOptions) {
}
finally
{
handleRuntimeError
(
errorRecord
);
}
});
}
,
options
.
filename
);
}
function
handleRuntimeError
(
errorRecord
)
{
...
...
This diff is collapsed.
Click to expand it.
packages/react-error-overlay/src/listenToRuntimeErrors.js
+
5
-
2
View file @
8a72a314
...
...
@@ -39,7 +39,10 @@ export type ErrorRecord = {|
stackFrames
:
StackFrame
[],
|
};
export
function
listenToRuntimeErrors
(
crash
:
ErrorRecord
=>
void
)
{
export
function
listenToRuntimeErrors
(
crash
:
ErrorRecord
=>
void
,
filename
:
string
=
'
/static/js/bundle.js
'
)
{
function
crashWithFrames
(
error
:
Error
,
unhandledRejection
=
false
)
{
getStackFrames
(
error
,
unhandledRejection
,
CONTEXT_SIZE
)
.
then
(
stackFrames
=>
{
...
...
@@ -68,7 +71,7 @@ export function listenToRuntimeErrors(crash: ErrorRecord => void) {
{
message
:
data
.
message
,
stack
:
data
.
stack
,
__unmap_source
:
'
/static/js/bundle.js
'
,
__unmap_source
:
filename
,
},
false
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment