File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
packages/react-devtools-shared/src
devtools/views/Components Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -3614,10 +3614,14 @@ export function attach(
3614
3614
// Log error & cause for user to debug
3615
3615
console . error ( message + '\n\n' , error ) ;
3616
3616
if ( error . cause != null ) {
3617
+ const fiber = findCurrentFiberUsingSlowPathById ( id ) ;
3618
+ const componentName =
3619
+ fiber != null ? getDisplayNameForFiber ( fiber ) : null ;
3617
3620
console . error (
3618
3621
'React DevTools encountered an error while trying to inspect hooks. ' +
3619
- 'This is most likely caused by an error in current inspected component.' +
3620
- 'The error thrown in the component is: \n\n' ,
3622
+ 'This is most likely caused by an error in current inspected component' +
3623
+ ( componentName != null ? `: "${ componentName } ".` : '.' ) +
3624
+ '\nThe error thrown in the component is: \n\n' ,
3621
3625
error . cause ,
3622
3626
) ;
3623
3627
if ( error . cause instanceof Error ) {
@@ -3643,7 +3647,9 @@ export function attach(
3643
3647
errorType : 'unknown-hook' ,
3644
3648
id,
3645
3649
responseID : requestID ,
3646
- message : 'Unsupported feature: ' + error . message ,
3650
+ message :
3651
+ 'Unsupported hook in the react-debug-tools package: ' +
3652
+ error . message ,
3647
3653
} ;
3648
3654
}
3649
3655
Original file line number Diff line number Diff line change @@ -63,7 +63,6 @@ export type OwnersList = {|
63
63
64
64
export type InspectedElementResponseType =
65
65
| 'error'
66
- | 'user-error'
67
66
| 'full-data'
68
67
| 'hydrated-path'
69
68
| 'no-change'
You can’t perform that action at this time.
0 commit comments