Can't fetch the source map while using the experimental debugger
Description
I'm trying to use the new experimental debugger in our RN project, but in the DevTool window it says this:
Failed to fetch source map http://10.39.25.45:8081/index.map?platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.teslamotors.enterpriseapp: remote fetches not permitted
and can't fetch the source map, thus no source code is shown.
Here're some interesting I've found:
-
I can access this URL in Safari and in CLI using
wgetandcurl, but I got this when I open it in Chrome: -
I noticed this using Chrome's dev tools:
https://github.com/user-attachments/assets/54f9a1d7-cc13-4b0f-a2ce-30dd38225ce6
The "content download" always gets killed after around 3.5s, and then it becomes "Aw Snap!"
- I tried to use the experimental debugger on the Expo tutorial's starter app, which works fine (I think it's using the experimental debugger, instead of the old one?)
- Our source map has ~200MB size
My assumption is that because our source map is so big, Chrome isn't able to download it within a time limit (so the download is always canceled after 3.5s) but I have no idea of how to verify that. Not sure if this is a Chrome bug or RN bug but I'll post it here anyway.
Steps to reproduce
Just launch the experimental debugger on some huge app with ~200MB source map, I guess?
React Native Version
0.73.6
Affected Platforms
Build - MacOS
Output of npx react-native info
npx react-native info
WARNING: You should run npx react-native@latest to ensure you're always using the most current version of the CLI. NPX has cached version (0.73.6) != current release (0.75.2)
info Fetching system and libraries information...
System:
OS: macOS 14.5
CPU: (12) arm64 Apple M3 Pro
Memory: 807.53 MB / 36.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.12.0
path: /usr/local/bin/node
Yarn:
version: 1.22.22
path: /opt/homebrew/bin/yarn
npm:
version: 8.19.2
path: ~/.nvm/versions/node/v18.12.0/bin/npm
Watchman:
version: 2024.07.15.00
path: /usr/local/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /Users/kainzhong/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- watchOS 10.2
Android SDK: Not Found
IDEs:
Android Studio: 2024.1 AI-241.15989.150.2411.11948838
Xcode:
version: 15.1/15C65
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.11
path: /usr/bin/javac
Ruby:
version: 2.7.5
path: /Users/kainzhong/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.6
wanted: 0.73.6
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
info React Native v0.75.2 is now available (your project is running on v0.73.6).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.75.2
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.75.2
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
Stacktrace or Logs
> Failed to fetch source map http://10.39.25.45:8081/index.map?platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.teslamotors.enterpriseapp: remote fetches not permitted
Reproducer
I really don't know how to reproduce this on smaller projects
Screenshots and Videos
Included some in the description.
| :warning: | Newer Version of React Native is Available! |
|---|---|
| :information_source: | You are on a supported minor version, but it looks like there's a newer patch available - 0.73.9. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
| :warning: | Missing Reproducible Example |
|---|---|
| :information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
| :warning: | Missing Reproducible Example |
|---|---|
| :information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
| :warning: | Newer Version of React Native is Available! |
|---|---|
| :information_source: | You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
I'm trying to use the new experimental debugger in our RN project, but in the DevTool window it says this:
Please update to 0.76.x and try React Native DevTools over there. We don't offer support for the experimental debugger for previous versions of React Native.
I'm trying to use the new experimental debugger in our RN project, but in the DevTool window it says this:
Please update to 0.76.x and try React Native DevTools over there. We don't offer support for the experimental debugger for previous versions of React Native.
OK let me try that (it might take some time to upgrade RN because it's a huge project but I'll try to get back to you ASAP)
This issue 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 issue was closed because it has been stalled for 7 days with no activity.
This issue was closed because it has been stalled for 7 days with no activity.
Sorry for the late reply... We were super busy with some other stuff and forgot to respond here.
In the end I found that the debugger is normal when debugging simulators. Setting BPs is normal too. Only when debugging a real device I'll see this Failed to fetch source map errror.
I think it's actually the problem of our company's network which blocks fetching sourcemap remotely, since if I fetch the sourcemap locally (from a simulator) then it is working