Skip to content

Pnpm package manager iOS ARCHIVE FAILED (Cannot find module '@sentry/cli/package.json') #4939

Open
@qnrjs42

Description

@qnrjs42

What React Native libraries do you use?

Hermes

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.15.1

How does your development environment look like?

⬇  Place the `npx react-native@latest info` output here. ⬇ 

npx react-native@latest info
Need to install the following packages:
[email protected]
Ok to proceed? (y) y

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: undefined@undefined
npm error Found: [email protected]
npm error node_modules/react-native
npm error   peer react-native@"*" from @react-native/[email protected]
npm error   node_modules/@react-native/virtualized-lists
npm error     @react-native/virtualized-lists@"0.74.83" from [email protected]
npm error   react-native@"0.80.0" from the root project
npm error
npm error Could not resolve dependency:
npm error react-native@"0.80.0" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/react
npm error   peer react@"^19.1.0" from [email protected]
npm error   node_modules/react-native
npm error     react-native@"0.80.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/custom/.npm/_logs/2025-06-23T07_33_41_197Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/custom/.npm/_logs/2025-06-23T07_33_41_197Z-debug-0.log

Sentry.init()

import * as Sentry from '@sentry/react-native';
import DeviceInfo from 'react-native-device-info';

import config from '@config';

export const utilSentryNavigationIntegration = Sentry.reactNavigationIntegration({
  enableTimeToInitialDisplay: true,
});

export const sentryInitData: Sentry.ReactNativeOptions = {
  dsn: config.sentry_dsn, // https://[email protected]/1234
  environment: config.mode, // development or produnction
  sendDefaultPii: true,
  tracesSampleRate: 1.0,
  // Configure Session Replay
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1,
  integrations: [
    utilSentryNavigationIntegration,
    Sentry.mobileReplayIntegration(),
    Sentry.feedbackIntegration(),
    Sentry.rewriteFramesIntegration(),
    Sentry.reactNativeTracingIntegration(),
  ],
};


const packageName = DeviceInfo.getBundleId();

const versionNumber = DeviceInfo.getVersion();

const versionCode = DeviceInfo.getBuildNumber();


Sentry.init({
  ...sentryInitData,
  release: `${packageName}@${versionNumber}+${versionCode}`,
  dist: versionCode,
});

export default (app: any) => Sentry.wrap(app);

Steps to Reproduce

Building the iOS app to upload to TestFlight.

Expected Result

The iOS build should not succeed if archiving fails.

Actual Result

▸ Linking my_app
⚠️  ld: ignoring duplicate libraries: '-lc++'
▸ Processing Info.plist
▸ Running script 'Bundle React Native code and images'
▸ Generating 'my_app.app.dSYM'
    Run script build phase '[CP-User] [Hermes] Replace Hermes for the right configuration, if needed' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'hermes-engine' from project 'Pods')
    Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'my_app' from project 'my_app')
    Run script build phase '[CP-User] [RNFB] Core Configuration' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'my_app' from project 'my_app')
    Run script build phase '[CP-User] [RNFB] Crashlytics Configuration' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'my_app' from project 'my_app')
    Run script build phase 'Upload Debug Symbols to Sentry' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'my_app' from project 'my_app')
** ARCHIVE FAILED **


The following build commands failed:
	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/my_app/ios/DerivedData/my_app/Build/Intermediates.noindex/ArchiveIntermediates/my_app/IntermediateBuildFilesPath/my_app.build/Release-iphoneos/my_app.build/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'my_app' from project 'my_app')
	Archiving workspace my_app with scheme my_app
(2 failures)
[10:33:45]: Exit status: 65

+-----------------------------------------+
|            Build environment            |
+---------------+-------------------------+
| xcode_path    | /Applications/Xcode.app |
| gym_version   | 2.227.1                 |
| export_method | app-store               |
| sdk           | iPhoneOS18.2.sdk        |
+---------------+-------------------------+

[10:33:45]: ▸ note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'DoubleConversion' from project 'Pods')
[10:33:45]: ▸ note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'AppsFlyerFramework-AppsFlyerLib_Privacy' from project 'Pods')
[10:33:45]: ▸ /Users/my_app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.2.99. (in target 'AppAuth-AppAuthCore_Privacy' from project 'Pods')
[10:33:45]: ▸ note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'AppAuth-AppAuthCore_Privacy' from project 'Pods')
[10:33:45]: ▸ note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'AppAuth' from project 'Pods')
[10:33:45]:
[10:33:45]: ⬆️  Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
[10:33:45]: 📋  For the complete and more detailed error log, check the full log at:
[10:33:45]: 📋  /Users/Library/Logs/gym/my_app-my_app.log
[10:33:45]:
[10:33:45]: Looks like fastlane ran into a build/archive error with your project
[10:33:45]: It's hard to tell what's causing the error, so we wrote some guides on how
[10:33:45]: to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
[10:33:45]: Before submitting an issue on GitHub, please follow the guide above and make
[10:33:45]: sure your project is set up correctly.
[10:33:45]: fastlane uses `xcodebuild` commands to generate your binary, you can see the
[10:33:45]: the full commands printed out in yellow in the above log.
[10:33:45]: Make sure to inspect the output above, as usually you'll find more error information there
[10:33:45]:
+---------------------------------------------------------------------------+
|                               Lane Context                                |
+------------------------------------+--------------------------------------+
| ENVIRONMENT                        | beta                                 |
| DEFAULT_PLATFORM                   | ios                                  |
| PLATFORM_NAME                      | ios                                  |
| LANE_NAME                          | ios beta                             |
| SIGH_PROFILE_TYPE                  | app-store                            |
| MATCH_PROVISIONING_PROFILE_MAPPING | {"com.chioboo.my-app"=>"  |
|                                    | match AppStore                       |
|                                    | com.chioboo.my-app"}      |
| VERSION_NUMBER                     | 0.7.14                               |
| BUILD_NUMBER                       | 1                                    |
+------------------------------------+--------------------------------------+
[10:33:45]: Called from Fastfile at line 94
[10:33:45]: ```
[10:33:45]:     92:	    )
[10:33:45]:     93:
[10:33:45]:  => 94:	    build_app(
[10:33:45]:     95:	      workspace: workspace,
[10:33:45]:     96:	      output_directory: "outputs/beta",
[10:33:45]: ```
[10:33:45]: Error building the application - see the log above

+---------------------------------------------+
|              fastlane summary               |
+------+------------------------+-------------+
| Step | Action                 | Time (in s) |
+------+------------------------+-------------+
| 1    | default_platform       | 0           |
| 2    | match                  | 4           |
| 3    | bash                   | 0           |
|      | ./change_app_identifi  |             |
|      | er.sh beta             |             |
| 4    | bash                   | 0           |
|      | ./change_appsflyer_na  |             |
|      | me.sh beta             |             |
| 5    | /usr/libexec/PlistBud  | 0           |
|      | dy -c "Set             |             |
|      | :CFBundleURLTypes:1:C  |             |
|      | FBundleU               |             |
| 6    | update_info_plist      | 0           |
| 7    | increment_version_num  | 0           |
|      | ber                    |             |
| 8    | increment_build_numbe  | 0           |
|      | r                      |             |
| 💥   | build_app              | 225         |
+------+------------------------+-------------+

[10:33:45]: fastlane finished with errors

[!] Error building the application - see the log above
grep -A 20 -B 5 "error\|Error\|ERROR" /Users/Library/Logs/gym/my_app-my_app.log | tail -50
Error: Cannot find module '@sentry/cli/package.json'
Require stack:
- /Users/my_app/ios/[eval]
    at Function._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Function.resolve (node:internal/modules/helpers:146:19)
    at [eval]:1:33
    at runScriptInThisContext (node:internal/vm:209:10)
    at node:internal/process/execution:449:12
    at [eval]-wrapper:6:24
    at runScriptInContext (node:internal/process/execution:447:60)
    at evalFunction (node:internal/process/execution:87:30)
    at evalScript (node:internal/process/execution:99:3)
    at node:internal/main/eval_string:74:3 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/my_app/ios/[eval]'
  ]
}

Node.js v22.14.0
+ SENTRY_CLI_PACKAGE_PATH=
--
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-jsitooling' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-jsinspectortracing' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-jsinspector' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-jsiexecutor' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-jsi' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-jserrorhandler' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-idlecallbacksnativemodule' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-hermes' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-graphics' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-featureflagsnativemodule' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-featureflags' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-domnativemodule' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-defaultsnativemodule' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-debug' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-cxxreact-React-cxxreact_privacy' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-cxxreact' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RuntimeHermes' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RuntimeCore' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RuntimeApple' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTVibration' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTText' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTSettings' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTRuntime' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTNetwork' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTLinking' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTImage' from project 'Pods')

Solution)

pnpm add -D @sentry/cli

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions