Skip to content

fix(cli,log-box): Drop obsolete rawBody parsing from createMetroMiddleware#43074

Merged
kitten merged 6 commits into
mainfrom
@kitten/refactor/drop-raw-body-workaround-for-metro
Feb 11, 2026
Merged

fix(cli,log-box): Drop obsolete rawBody parsing from createMetroMiddleware#43074
kitten merged 6 commits into
mainfrom
@kitten/refactor/drop-raw-body-workaround-for-metro

Conversation

@kitten

@kitten kitten commented Feb 11, 2026

Copy link
Copy Markdown
Member

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

This increases the efficiency of the `Body` helper but doesn't change
things otherwise. Older versions are fine and this is optional for this
branch.
@github-actions

Copy link
Copy Markdown
Contributor

Subscribed to pull request

File Patterns Mentions
packages/@expo/cli/** @EvanBacon, @byCedric
packages/@expo/log-box/** @EvanBacon, @krystofwoldrich

Generated by CodeMention

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Feb 11, 2026
@kitten
kitten force-pushed the @kitten/refactor/drop-raw-body-workaround-for-metro branch from 82b4d43 to 39e0672 Compare February 11, 2026 14:59
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Feb 11, 2026
@expo-bot

expo-bot commented Feb 11, 2026

Copy link
Copy Markdown
Collaborator

The Pull Request introduced fingerprint changes against the base commit: 34399b4

Fingerprint diff
[
  {
    "op": "changed",
    "beforeSource": {
      "type": "dir",
      "filePath": "../../packages/@expo/log-box",
      "reasons": [
        "expoAutolinkingIos",
        "expoAutolinkingAndroid"
      ],
      "hash": "6e9f78bcd240b779dcce6c6f0c024d527571b924"
    },
    "afterSource": {
      "type": "dir",
      "filePath": "../../packages/@expo/log-box",
      "reasons": [
        "expoAutolinkingIos",
        "expoAutolinkingAndroid"
      ],
      "hash": "5f1c6eec678649e4e0485d58871b8055bb798445"
    }
  }
]

Generated by PR labeler 🤖

return next();
}
try {
const frame = await new Body(req).json();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is equivalent to using json from node:stream/consumers. However, I've put in fetch-nodestream's Body here since it's more portable, so using this in more places aligns us to Web-like usage, as we adopt more of this over time

@kitten
kitten merged commit 0084541 into main Feb 11, 2026
39 checks passed
@kitten
kitten deleted the @kitten/refactor/drop-raw-body-workaround-for-metro branch February 11, 2026 15:30
@alanjhughes alanjhughes added the published Changes from the PR have been published to npm label Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot: fingerprint changed bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants