[LogBox] Parse bundling errors from Metro Dev Server and avoid symbolicating them#53452
Conversation
rickhanlonii
left a comment
There was a problem hiding this comment.
This doesn't seem right, we were definitely handling this in the past and there are some unit tests for it like this one.
In your screenshot it looks like there's a codeframe in the message. We attempt to detect any babel errors, and then we render the code frame in LogBox so you can see the issue in the app. This is better than your "after" screenshot, which only shows the message.
I think the problem here is that the error type is "UnableToResolveError" but it should be TransformError like in the test above. Do you know where that error type is coming from?
| : undefined) | ||
| if (bundlingError) { | ||
| return LogBoxData.addLog(bundlingError); | ||
| } |
There was a problem hiding this comment.
This is the wrong place for this
|
Inside of the application this error is received by the HMRClient which repacks and throws this error. This thrown error is captured by EventTarget implementation. Looking at this now, I agree and better place to change could be the HMRClient to avoid throwing the compilation error. Changed in |
…d symbolicating them" This reverts commit 8997dd0.
|
Hi @rickhanlonii, |
|
cc @vzaidman for visibility also |
|
|
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR was closed because it has been stalled for 7 days with no activity. |

Summary:
This PR improves bundling (transform, syntax and internal Metro errors) handling.
Currently LogBox attaches synthetic stack trace to these errors which is misleading.
The synthetic stack trace also triggers symbolication which will fail causing long and duplicate logs in the metro dev server output.
This PR reuses LogBox Exception parsing for Log parsing as Metro errors are logged using
console.error.Changelog:
[GENERAL] [FIXED] - Parse Metro bundling errors and avoid symbolication
Test Plan:
Example after the PR:

Before the PR:

