Open jonthysell opened 1 year ago
I have confirmed that if I manually edit the bundle file and specify the full path on disk to the source map file, the debugger will work correctly.
I've also confirmed that I can modify the Bundle.props
file to put the source map alongside the bundle file in the Bundle folder so it's included in the appx (or just in the build output for unpackaged apps).
I've not confirmed if it's possible for the debugger to actually load the source map out of the appx via a ms-appx://
url.
Also I'm not entirely sure it would even make sense to include the source map file in any final build output, given that the source map file itself maps to the original source paths on the disk, which must be present for debugging to work.
If we try --sourcemap-use-absolute-path
does that fix the default case here?
Problem Description
When using Visual Studio to Direct Debug an RNW app using Chakra, it works fine when using Metro because the bundle specifies a full source map URL (pointed at http://localhost:8081) that the VS debugger can load in order to get source-stepping and breakpoints.
However, when building an offline bundle file, the source map URL in the bundle file is set to the relative
index.windows.bundle.map
. So while VS can technically connect to the app with Direct Debugging, it fails to load the map, so you lose source-stepping and breakpoints.The problem is two-fold:
$(ProjectDir)$(OutDir)\sourcesmaps\react
, which is not included in the final appxSteps To Reproduce
yarn windows --no-packager --msbuildprops UseBundle=true
)Script
Expected Results
Debugger attaches. I can set breakpoints and step through the source.
CLI version
npx react-native --version
Environment
Target Platform Version
10.0.19041
Target Device(s)
Desktop
Visual Studio Version
None
Build Configuration
DebugBundle
Snack, code example, screenshot, or link to a repository
No response