Skip to content

[devtools] Fix "View source" for sources with URLs that aren't normalized#32951

Merged
eps1lon merged 3 commits intofacebook:mainfrom
eps1lon:sebbie/rdt-open-source-normalized
Apr 17, 2025
Merged

[devtools] Fix "View source" for sources with URLs that aren't normalized#32951
eps1lon merged 3 commits intofacebook:mainfrom
eps1lon:sebbie/rdt-open-source-normalized

Conversation

@eps1lon
Copy link
Copy Markdown
Collaborator

@eps1lon eps1lon commented Apr 17, 2025

Summary

Chrome lists resources with their normalized URLs. However, sourcemaps may contain unnormalized URLs in their sources. When symbolicating we get the original entry in sources not the normalized URL so we need to consider that when calling openResource. Otherwise nothing happens and you only see an error when you actually inspect React DevTools e.g. extensions.js:1 Extension server error: Object not found: webpack-internal:///(app-pages-browser)/./app/page.tsx

How did you test this change?

Use a local build (yarn build:chrome:local) in a basic Next.js app with Webpack and click "View source" for the root page.

Firefox has "View source" disabled for me even with the published version.

@eps1lon eps1lon requested a review from hoxyq April 17, 2025 16:32
@github-actions github-actions Bot added the React Core Team Opened by a member of the React Core Team label Apr 17, 2025
Comment thread packages/react-devtools-shared/src/utils.js
@eps1lon eps1lon force-pushed the sebbie/rdt-open-source-normalized branch from f5307e2 to d7ad0d2 Compare April 17, 2025 18:46
@eps1lon eps1lon merged commit bc6184d into facebook:main Apr 17, 2025
239 checks passed
@eps1lon eps1lon deleted the sebbie/rdt-open-source-normalized branch May 7, 2025 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants