Skip to content

Expo iOS plugin double-quotes already-quoted bundle script invocations #6795

Description

@eliotgevers

What React Native libraries do you use?

Expo (mobile only), Hermes, RN New Architecture

Are you using sentry.io or on-premise?

sentry.io (SaS); the failure occurs locally before uploading anything.

Are you using any other error monitoring solution alongside Sentry?

No

@sentry/react-native SDK Version

8.28.0. Current main (b3e4a5c2c4ddbef59a1df725dcadec59e4d7305f) has the same behavior.

How does your development environment look like?

macOS 27.0, Node 26.8.1, Expo 58.0.0-preview.8, React 19.3.0, React Native 0.88.0-rc.2. A fresh Expo 57.0.25 project uses the older unquoted template and serves as a control.

Sentry.init()

Not needed to reproduce: this happens in the Expo config plugin. The reproduction uses @sentry/react-native/expo in app.json, with disableAutoUpload: true.

Steps to Reproduce

  1. Create an Expo app using SDK 58 preview and install @sentry/react-native@8.28.0. Keep that explicit version if Expo's dependency check recommends an older Sentry SDK.
  2. Add the Sentry Expo config plugin and place the app in a directory containing spaces, such as Expo Quoting Repro.
  3. Run npx expo prebuild --clean --platform ios --no-install.
  4. Inspect or execute the generated “Bundle React Native code and images” phase.

Expo's official template already quotes its react-native-xcode.sh command substitution. addSentryWithBundledScriptsToBundleShellScript adds another pair of double quotes, exposing the resolved path to shell word splitting.

The same transformation can be inspected without generating a native project:

const { addSentryWithBundledScriptsToBundleShellScript } = require(
  '@sentry/react-native/plugin/build/withSentryIOS',
);
console.log(addSentryWithBundledScriptsToBundleShellScript(
  '"/tmp/My App/scripts/react-native-xcode.sh"',
));
// Ends with: ""/tmp/My App/scripts/react-native-xcode.sh""
// Should end with: "/tmp/My App/scripts/react-native-xcode.sh"

Expected Result

Preserve Expo's existing quotes and pass the complete resolved React Native script path as one argument. Older unquoted template invocations should still be quoted once.

Actual Result

The generated phase contains "" around the command substitution. Executing it through /bin/sh with real Node resolution and the installed Sentry wrapper passes only the path up to the first space as $1, then fails with No such file or directory (exit 127).

This is the remaining already-quoted-input case after #6583 / #6604, not a request to revert that fix. Preserving existing outer quotes resolves it. A regression test fails on main and passes with that change. A fresh prebuild using the compiled candidate also executes the generated Debug phase successfully with both disableAutoUpload settings. This is generated-script verification, not a full native build or upload test.

Proposed fix: #6796.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions