Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sourceUrl content to source infos for parsed source maps #195

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vzaidman
Copy link

While sourceContent is an optional source map field, it is required for certain behaviors since it's the only field that is used to populate #sourceInfos/#sourceInfoByURL that serves as a source-map-to-source-content mapping for source maps.

This creates issues with legitimate source maps that omit sourceContent and provide source urls instead. e.g. see the description for this bug that I've just fixed on React Native's Metro Hot Reload where the code that checks if source maps are compatible with each other fails to recognize they are not compatible, unless sourceContent is provided, thus adding source maps for files instead of replacing them for files with different source code.

I don't have the context on what's the full correct solution, but essentially, I think #sourceInfos/#sourceInfoByURL should be populated with the contents of source files fetched from sources if sourceContent is missing.

@bmeurer
Copy link
Contributor

bmeurer commented Jan 28, 2025

Thanks for the patch! Can you please upload the fix via Gerrit, see this part of the Contribution Guide for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants