-
Notifications
You must be signed in to change notification settings - Fork 613
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
Fix sourceMapURL when building bundles for windows/macOS #763
Conversation
I'm trying to track down why we have this hack in the first place and whether it's necessary to enumerate these specific platforms in Metro core. (Platforms are configurable in Metro so any hardcoding of platform IDs is a code smell.) Could we, for example: (ideas off the top of my head)
|
@motiz88 - Looks like vr went ahead and also added themselves to this hack. -- While I agree it would be better to fix it properly, can we at least get these main platforms in rather than blocking on cleaning this up? |
@acoates-ms I'll merge this, though I'm wary of shipping code we don't fundamentally understand. Can you please help with the followup here? In particular, it's not clear to me what you were referring to by "Chrome debugger" above - do you mean remote debugging (code executes in a browser) or direct debugging (code runs in RN's VM)? |
@motiz88 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Chrome debugger using CDP to direct debug against the VM in RN. -- I believe the comment added in the vr commit is incorrect, this is needed even now that we are not using remote debugging. Its an onion of fixes needed to completely fix things though. Last time I looked at this, there was still an issue with chrome not loading the URL, even though it would now be a correct URL due to some sandboxing of requests allowed from the debugger context. - although if you run the chrome debugger in "node" debugging mode, then it would load the sourcemap with this fix. |
Yeah, we're aware of the issue with Chrome not fetching source maps over the network in general. There's a workaround in inspector-proxy that we're hoping to eventually replace with support for For context: The workaround introduced a bug via accidental CDP message reordering, and proxying the fetch through the device would allow for distributed/tunnelled setups where the Metro URL known to the app isn't necessarily routable from where inspector-proxy is running. |
Summary: **Summary** The sourceMapUrl in bundles built for windows/macOS is of the format ``` //# sourceMappingURL=//localhost:8081/index.map?platform=windows&dev=true&hot=false&inlineSourceMap=false ``` This causes the chrome debugger to be unable to correctly load the source map. It turns out there is already code to modify this specifically for android/iOS. This change makes windows/macOS behavior match android/iOS. See microsoft/react-native-windows#9407. Pull Request resolved: #763 Reviewed By: robhogan Differential Revision: D51031030 Pulled By: motiz88 fbshipit-source-id: a325e417d725c53c5d96866d80f300a72389e4c2
Summary: **Summary** The sourceMapUrl in bundles built for windows/macOS is of the format ``` //# sourceMappingURL=//localhost:8081/index.map?platform=windows&dev=true&hot=false&inlineSourceMap=false ``` This causes the chrome debugger to be unable to correctly load the source map. It turns out there is already code to modify this specifically for android/iOS. This change makes windows/macOS behavior match android/iOS. See microsoft/react-native-windows#9407. Pull Request resolved: #763 Reviewed By: robhogan Differential Revision: D51031030 Pulled By: motiz88 fbshipit-source-id: a325e417d725c53c5d96866d80f300a72389e4c2
Summary: **Summary** The sourceMapUrl in bundles built for windows/macOS is of the format ``` //# sourceMappingURL=//localhost:8081/index.map?platform=windows&dev=true&hot=false&inlineSourceMap=false ``` This causes the chrome debugger to be unable to correctly load the source map. It turns out there is already code to modify this specifically for android/iOS. This change makes windows/macOS behavior match android/iOS. See microsoft/react-native-windows#9407. Pull Request resolved: #763 Reviewed By: robhogan Differential Revision: D51031030 Pulled By: motiz88 fbshipit-source-id: a325e417d725c53c5d96866d80f300a72389e4c2
Summary
The sourceMapUrl in bundles built for windows/macOS is of the format
This causes the chrome debugger to be unable to correctly load the source map. It turns out there is already code to modify this specifically for android/iOS. This change makes windows/macOS behavior match android/iOS.
See microsoft/react-native-windows#9407.