Skip to content

Conversation

@emily8rown
Copy link

Summary

Add missing Content-Type: application/json header to the "Open in Editor" fetch request.

The /open-stack-frame endpoint expects a JSON body, but the fetch call was missing the Content-Type header. This caused Metro's body parser to reject the request when running in strict mode.

Test plan

  1. Build the debugger-frontend
  2. Start Metro with DEV=1 js1 run
  3. Open React Native DevTools (press j in Metro terminal)
  4. Go to the Sources tab and navigate to a source file
  5. Click the "Open in Editor" button
  6. Verify the file opens in your editor
  • This change maintains backwards compatibility with previous Local Storage data (if modifying settings, experiments, or other persisted client state).

Upstreaming plan

@meta-cla meta-cla bot added the cla signed label Dec 18, 2025
@emily8rown emily8rown merged commit 1f006e2 into facebook:main Dec 18, 2025
5 checks passed
meta-codesync bot pushed a commit to facebook/react-native that referenced this pull request Dec 19, 2025
…el devtools button (#54927)

Summary:
Updating front end assets for facebook/react-native-devtools-frontend#229

The "Open in Editor" button in the Sources tab was failing with a 400 Bad Request error. This was because the openStackFrameInEditor request was missing the Content-Type header. Added the appropriate content type header to fix the request.

## Changelog:

[GENERAL] [INTERNAL] - Fix "Open in Editor" button in Sources tab returning 400 Bad Request

Pull Request resolved: #54927

Test Plan:
Open React Native DevTools
Go to Sources tab
Click "Open in Editor" button on a stack frame
Verify the file opens in the editor without a 400 error

Reviewed By: vzaidman

Differential Revision: D89464184

Pulled By: emily8rown

fbshipit-source-id: 27190e05e11d96bdd9982a4e057c3ef225975bc4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants