mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
[DevTools] fix: always send a response to fetch-file request in the extension (#34235)
This fixes the displaying of "rendered by" section if owner stacks contained any native frames. This regressed after https://github.com/facebook/react/pull/34185, where we added the Suspense boundary for the StackTraceView. This fails because the Promise that is responsible for symbolication of the source is never getting resolved or rejected. Previously, we would just throw an Error without sending a corresponding message to the `main` script, and it would just cache a Promise that is never resolved, hence the Suspense boundary for "rendered by" section is never resolved. In a separate change, I think we need to update StackTraceView component to display `native` as location, instead of `:0`: <img width="712" height="118" alt="Screenshot 2025-08-20 at 00 20 42" src="https://github.com/user-attachments/assets/c79735c9-fdd2-467c-96cd-2bc29d38c4e0" />
This commit is contained in:
parent
3770ff3853
commit
8120753665
|
|
@ -46,14 +46,17 @@ export function handleDevToolsPageMessage(message) {
|
|||
payload: {tabId, url},
|
||||
} = message;
|
||||
|
||||
if (!tabId) {
|
||||
throw new Error("Couldn't fetch file sources: tabId not specified");
|
||||
}
|
||||
|
||||
if (!url) {
|
||||
throw new Error("Couldn't fetch file sources: url not specified");
|
||||
}
|
||||
|
||||
if (!tabId || !url) {
|
||||
// Send a response straight away to get the Promise fulfilled.
|
||||
chrome.runtime.sendMessage({
|
||||
source: 'react-devtools-background',
|
||||
payload: {
|
||||
type: 'fetch-file-with-cache-error',
|
||||
url,
|
||||
value: null,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
chrome.tabs.sendMessage(tabId, {
|
||||
source: 'devtools-page',
|
||||
payload: {
|
||||
|
|
@ -61,6 +64,7 @@ export function handleDevToolsPageMessage(message) {
|
|||
url,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user