Skip to content

[cli] Remove rawBody handling on /symbolicate endpoint#35757

Closed
huntie wants to merge 1 commit into
expo:mainfrom
huntie:drop-symbolicate-handling
Closed

[cli] Remove rawBody handling on /symbolicate endpoint#35757
huntie wants to merge 1 commit into
expo:mainfrom
huntie:drop-symbolicate-handling

Conversation

@huntie

@huntie huntie commented Mar 28, 2025

Copy link
Copy Markdown

Why

This removes a longstanding hack that covered for a lack of JSON body parsing in Metro's /symbolicate endpoint. We're now resolving this in react/metro#1475 — meaning this can be removed from Expo CLI.

Related PRs:

How

Delete interception of /symbolicate in Expo CLI middleware stack.

Test Plan

  • Link local metro into a local checkout of Expo via yarn link.
  • cd apps/bare-expo
  • yarn ios
  • Open app, modified to throw an error on launch.

[Incoming]

Important

We'll wait for the relevant release of Metro to land on main first. See @byCedric's comment below.

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Mar 28, 2025
@huntie
huntie force-pushed the drop-symbolicate-handling branch 2 times, most recently from eb22657 to c30f810 Compare March 28, 2025 14:33
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Mar 28, 2025
@huntie
huntie force-pushed the drop-symbolicate-handling branch from c30f810 to 58465ee Compare March 28, 2025 14:52
@byCedric

Copy link
Copy Markdown
Member

I approved the CI for this PR, but we can only merge this once the Metro changes are published and we switched over to that Metro version on main 😄

@huntie
huntie marked this pull request as ready for review March 28, 2025 16:11
@github-actions

Copy link
Copy Markdown
Contributor

Subscribed to pull request

File Patterns Mentions
packages/@expo/cli/** @EvanBacon, @byCedric

Generated by CodeMention

@huntie

huntie commented Mar 28, 2025

Copy link
Copy Markdown
Author

@byCedric Cool, makes sense. I've published the PR; we'll come back to it later.

@huntie
huntie force-pushed the drop-symbolicate-handling branch from 58465ee to aab8c03 Compare April 28, 2025 13:59
@huntie

huntie commented Apr 28, 2025

Copy link
Copy Markdown
Author

Push: Resolve CHANGELOG.md conflict. @byCedric I think if Expo has updated Metro by now, we can E2E validate this and merge.

@huntie

huntie commented May 1, 2025

Copy link
Copy Markdown
Author

@byCedric We shipped Metro 0.82.2 with the relevant change.

@vonovak
vonovak requested review from byCedric and kitten February 11, 2026 10:43
@kitten

kitten commented Feb 11, 2026

Copy link
Copy Markdown
Member

We can't merge this until all requests to /symbolicate use Content-Type: application/json which is a new forced requirement in Metro. I'll have to see if that's hard to update across the board since there might be many callers of that endpoint

Edit: This seems to be a trivial update for, us so I'll file a replacement PR

@kitten kitten closed this Feb 11, 2026
@huntie
huntie deleted the drop-symbolicate-handling branch February 11, 2026 15:07
kitten added a commit that referenced this pull request Feb 11, 2026
…ddleware` (#43074)

# Why

Supersedes #35757

> This removes a longstanding hack that covered for a lack of JSON body
parsing in Metro's `/symbolicate` endpoint. We're now resolving this in
react/metro#1475 — meaning this can be
removed from Expo CLI.
> — @huntie

This also raised that we had two calls to `/symbolicate` that weren't
being called with `application/json`. However, without the `rawBody`
property, Metro's middlewares now expect the `Content-Type:
application/json` header.

# How

- Update `@expo/log-box` to set `Content-Type: application/json` on JSON
POST requests
- Update `@expo/cli` to set `Content-Type: application/json` on internal
`/symbolicate` request
- Drop `rawBodyMiddleware` from CLI's `createMetroMiddleware`
- Replace `rawBody` with JSON body parsing for `/open-stack-frame`

# Test Plan

- Run app and cause an error with a stack trace
  - The `/symbolicate` call should work as before
  - Clicking a frame, `/open-stack-frame` should work as before

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
-->

- [x] I added a `changelog.md` entry and rebuilt the package sources
according to [this short
guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot: passed checks ExpoBot has nothing to complain about

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants