Skip to content

workspace is not supported (as per 7.8.0) #5512

@bondarenkod

Description

@bondarenkod

What React Native libraries do you use?

React Native (no additional frameworks)

Are you using sentry.io or on-premise?

sentry.io (SaaS)

@sentry/react-native SDK Version

7.8.0

How does your development environment look like?

This likely isn’t relevant to the issue, but included for completeness.

System:
  OS: Windows 11 10.0.26200
  CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
  Memory: 32.19 GB / 63.71 GB
Binaries:
  Node:
    version: 22.18.0
    path: C:\Users\DARPA\AppData\Roaming\fnm\node-versions\v22.18.0\installation\node.EXE
  Yarn:
    version: 4.12.0
    path: C:\Users\DARPA\AppData\Roaming\fnm\node-versions\v22.18.0\installation\yarn.CMD
  npm:
    version: 10.9.3
    path: C:\Users\DARPA\AppData\Roaming\fnm\node-versions\v22.18.0\installation\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "33"
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 33.0.0
      - 34.0.0
      - 35.0.0
      - 35.0.1
      - 36.0.0
    System Images:
      - android-34 | Google Play Intel x86_64 Atom
      - android-35 | Google Play Intel x86_64 Atom
      - android-36 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.14.36705.20 (Visual Studio Community 2022)
Languages:
  Java:
    version: 17.0.17
    path: C:\Program Files\Microsoft\jdk-17.0.17.10-hotspot\bin\javac.EXE
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 19.2.0
    wanted: 19.2.0
  react-native:
    installed: 0.83.1
    wanted: ^0.83.0
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Sentry.init()

Sentry.init({
  dsn: 'https://...@sentry.io/...',
  // other options
});

Steps to Reproduce

  1. Create a workspace-based (monorepo) project using Yarn Berry.
  2. Use a workspace structure similar to the following (note: node_modules is at the repository root):
/root
  /mobile
    /RNBasedMobileApplication  <- React Native app (supported by RN for a long time, at least since ~0.73)
  /infrastructure
  /common
  /web
  /node_modules               <- node_modules directory is here
  package.json
  1. Install and configure an older @sentry/react-native version (e.g., 7.7.0). The iOS build works with this file structure.

  2. Upgrade to @sentry/react-native 7.8.0 and build for iOS. The build fails (see “Actual Result”).

  3. Ensure you enable debug logs by adding the following to .xcode.env:

    • export SENTRY_LOG_LEVEL=debug

Additional Context

It appears that a recent change hard-codes the default path to the React Native Xcode script as:

REACT_NATIVE_XCODE_DEFAULT="../node_modules/react-native/scripts/react-native-xcode.sh"

In a workspace/monorepo where node_modules is located at the repository root, this relative path can become invalid. Related change:
459a438#diff-adc0bbd34cc2ce0ddb7585ef1c52dd0cf4706cf97c701a0962b6679daa29fe1f

Expected Result

  1. Sentry should support workspace/monorepo React Native projects where node_modules is located at the repository root (a common Yarn Berry / workspace setup).

  2. Any breaking changes should be clearly documented in release notes.

    • In particular, changes affecting the Xcode build phase integration should be explicitly called out and accompanied by:

      • a clear warning / migration note, and ideally
      • an auto-migration, or at minimum a deliberate, actionable failure message during install/build indicating exactly what to change.

This kind of behavior was not expected for a minor version update.

Actual Result

iOS build error:

++ echo 'error: sentry-cli - REACT_NATIVE_XCODE script not found at: /Users/DARPA/Documents/src/rn01/mobile/EYE/node_modules/react-native/scripts/react-native-xcode.sh'

Additionally (likely related), in CI when SENTRY_LOG_LEVEL is not set, the logs are much less actionable and the build fails with a large set of errors, for example:

error export CLANG_WARN_DOCUMENTATION_COMMENTS\=YES
error export CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER\=NO
error export GCC_WARN_INHIBIT_ALL_WARNINGS\=YES
error export VALIDATE_PRODUCT\=YES
error .h /Users/DARPA/azba/MacMini-VM12-01/_work/2/s/DARPACore.ReactNative/mobile/DemoApp2/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageError.h (in target 'SDWebImage' from project 'Pods')
error .h /Users/DARPA/azba/MacMini-VM12-01/_work/2/s/DARPACore.ReactNative/mobile/DemoApp2/ios/obj/Build/Intermediates.noindex/ArchiveIntermediates/DemoApp2/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SDWebImage.framework/Headers
error .h /Users/DARPA/azba/MacMini-VM12-01/_work/2/s/DARPACore.ReactNative/node_modules/react-native/ReactCommon/cxxreact/RecoverableError.h (in target 'React-cxxreact' from project 'Pods')
error .h /Users/DARPA/azba/MacMini-VM12-01/_work/2/s/DARPACore.ReactNative/mobile/DemoApp2/ios/obj/Build/Intermediates.noindex/ArchiveIntermediates/DemoApp2/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/cxxreact.framework/Headers
error .h /Users/DARPA/azba/MacMini-VM12-01/_work/2/s/DARPACore.ReactNative/mobile/DemoApp2/ios/Pods/PromisesObjC/Sources/FBLPromises/include/FBLPromiseError.h (in target 'PromisesObjC' from project 'Pods')
error .h /Users/DARPA/azba/MacMini-VM12-01/_work/2/s/DARPACore.ReactNative/mobile/DemoApp2/ios/obj/Build/Intermediates.noindex/ArchiveIntermediates/DemoApp2/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FBLPromises.framework/Headers
error .h /Users/DARPA/azba/MacMini-VM12-01/_work/2/s/DARPACore.ReactNative/mobile/DemoApp2/ios/Pods/AppAuth/Sources/AppAuthCore/OIDError.h (in target 'AppAuth' from project 'Pods')
error .h /Users/DARPA/azba/MacMini-VM12-01/_work/2/s/DARPACore.ReactNative/mobile/DemoApp2/ios/obj/Build/Intermediates.noindex/ArchiveIntermediates/DemoApp2/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AppAuth.framework/Headers

Metadata

Metadata

Assignees

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions