facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.44k stars 24.37k forks source link

Can't fetch the source map while using the experimental debugger #46283

Open PRESIDENT810 opened 2 months ago

PRESIDENT810 commented 2 months ago

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:

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!"

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.

react-native-bot commented 2 months ago
: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.
react-native-bot commented 2 months ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
react-native-bot commented 2 months ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
react-native-bot commented 2 months ago
: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.
cortinico commented 2 months ago

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.

PRESIDENT810 commented 2 months ago

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)