"Error: No platform selected" on sentry-wizard after eject

Please provide the following:

  1. SDK Version: 41
  2. Platforms(Android/iOS/web/all): iOS/Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

I recently upgraded expo SDK 40 to 41 using managed workflow. I had sentry set up and working fine for a while before the upgrade. I then did an expo eject, and proceeded to continue the extra setup for sentry when I get an error:

$ npm install @sentry/react-native
...completes successfully...
$ npx sentry-wizard -i reactNative -p ios android
Running Sentry Wizard...
version: 1.2.6 | sentry-cli version: 1.64.1
Sentry Wizard will help you to configure your project
Thank you for using Sentry :)


Please open
https://sentry.io/account/settings/wizard/[...abc123...]/
in your browser (if it's not open already)


✅ Patched build.gradle file.
Error: No platform selected
    at ReactNative.MobileProject.getPlatforms (/[path]/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/MobileProject.js:65:19)
    at ReactNative._patchJs (/[path]/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/ReactNative.js:224:14)
    at /[path]/node_modules/@sentry/wizard/dist/lib/Helper/File.js:28:45
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
✅ Patched build script in Xcode project.
Error: No platform selected
    at ReactNative.MobileProject.getPlatforms (/[path]/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/MobileProject.js:65:19)
    at ReactNative._patchJs (/[path]/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/ReactNative.js:224:14)
    at /[path]/node_modules/@sentry/wizard/dist/lib/Helper/File.js:28:45
    at processTicksAndRejections (node:internal/process/task_queues:94:5)

🎉  Successfully set up Sentry for your project 🎉

The browser log in for Sentry is successful during that command, but no extra Sentry.init() is added to App.js like it used to do when I did this same procedure with SDK 40. Trying to continue on with npx pod-install and npm run ios results in a build error which I assume is from the sentry-wizard not actually having worked successfully:

error: An organization slug is required (provide with --org)

Does anyone know what might be going on?

Here is my sentry code in App.js

Sentry.init({
  dsn: 'https://[...URL...]',
  enableInExpoDevelopment: false,
  debug: true
});

and my app.json

{
  "expo": {
    ...
    "hooks": {
      "postPublish": [
        {
          "file": "sentry-expo/upload-sourcemaps",
          "config": {
            "organization": "[myorg]",
            "project": "[myproject]",
            "authToken": "[mytoken]"
          }
        }
      ]
    }
  }
}

Hey @duggster, the configuration via sentry-wizard is only for bare projects. Using Sentry - Expo Documentation

Cheers,
Adam

Thanks for the reply @adamjnav - I start with managed workflow where I am not trying to run sentry-wizard. However, my process is that I do development in managed workflow and then in a separate branch I eject to bare workflow when it comes time to release. I am only trying to run sentry-wizard after I eject to bare workflow. I did this process just a few weeks ago and it worked fine. The only thing that’s different from then is I did the expo upgrade on my managed workflow branch to bring it up to SDK 41, then ejected to bare workflow to make sure things are all working the same. After ejecting is when I encounter this error.

In case it helps, I have attached the output using sentry-wizard with the --debug flag. I notice it says ios/sentry.properties and android/sentry.properties don’t exist, but I thought those maybe got handled by expo somewhere (I have never had to deal with them before).

$ npx sentry-wizard -i reactNative -p ios android --debug
{
	"_": [],
	"debug": true,
	"uninstall": false,
	"skip-connect": false,
	"skipConnect": false,
	"quiet": false,
	"i": "reactNative",
	"integration": "reactNative",
	"p": [
		"ios",
		"android"
	],
	"platform": [
		"ios",
		"android"
	],
	"u": "https://sentry.io/",
	"url": "https://sentry.io/",
	"$0": "[path]/node_modules/.bin/sentry-wizard"
}
Running Sentry Wizard...
version: 1.2.6 | sentry-cli version: 1.64.1
Sentry Wizard will help you to configure your project
Thank you for using Sentry :)

ios/sentry.properties not exists


android/sentry.properties not exists


ios/sentry.properties not exists


android/sentry.properties not exists

/
Loading wizard for https://sentry.io/



Please open
https://sentry.io/account/settings/wizard/[hash]/
in your browser (if it's not open already)


ios/sentry.properties not exists


android/sentry.properties not exists


{
	"integration": {
		"_argv": {
			"_": [],
			"debug": true,
			"uninstall": false,
			"skip-connect": false,
			"skipConnect": false,
			"quiet": false,
			"i": "reactNative",
			"integration": "reactNative",
			"p": [
				"ios",
				"android"
			],
			"platform": [
				"ios",
				"android"
			],
			"u": "https://sentry.io/",
			"url": "https://sentry.io/",
			"$0": "[path]/node_modules/.bin/sentry-wizard"
		},
		"_isDebug": true,
		"_sentryCli": {
			"_argv": {
				"_": [],
				"debug": true,
				"uninstall": false,
				"skip-connect": false,
				"skipConnect": false,
				"quiet": false,
				"i": "reactNative",
				"integration": "reactNative",
				"p": [
					"ios",
					"android"
				],
				"platform": [
					"ios",
					"android"
				],
				"u": "https://sentry.io/",
				"url": "https://sentry.io/",
				"$0": "[path]/node_modules/.bin/sentry-wizard"
			}
		},
		"_platforms": [
			"ios",
			"android"
		]
	},
	"shouldConfigurePlatforms": {
		"ios": true,
		"android": true
	},
	"hash": "[hash]"
}

/
Polling: https://sentry.io/api/0/wizard/[hash]/

/ Waiting for Sentry...
Polling received data


Polling received:


Error: Received status 400
    at WaitForSentry.<anonymous> ([path]/node_modules/@sentry/wizard/dist/lib/Steps/WaitForSentry.js:95:63)
    at step ([path]/node_modules/@sentry/wizard/dist/lib/Steps/WaitForSentry.js:46:23)
    at Object.next ([path]/node_modules/@sentry/wizard/dist/lib/Steps/WaitForSentry.js:27:53)
    at fulfilled ([path]/node_modules/@sentry/wizard/dist/lib/Steps/WaitForSentry.js:18:58)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)

\ Waiting for Sentry...
Polling: https://sentry.io/api/0/wizard/[hash]/

- Waiting for Sentry...
Polling received data



Polling Success!


{
	"integration": {
		"_argv": {
			"_": [],
			"debug": true,
			"uninstall": false,
			"skip-connect": false,
			"skipConnect": false,
			"quiet": false,
			"i": "reactNative",
			"integration": "reactNative",
			"p": [
				"ios",
				"android"
			],
			"platform": [
				"ios",
				"android"
			],
			"u": "https://sentry.io/",
			"url": "https://sentry.io/",
			"$0": "[path]/node_modules/.bin/sentry-wizard"
		},
		"_isDebug": true,
		"_sentryCli": {
			"_argv": {
				"_": [],
				"debug": true,
				"uninstall": false,
				"skip-connect": false,
				"skipConnect": false,
				"quiet": false,
				"i": "reactNative",
				"integration": "reactNative",
				"p": [
					"ios",
					"android"
				],
				"platform": [
					"ios",
					"android"
				],
				"u": "https://sentry.io/",
				"url": "https://sentry.io/",
				"$0": "[path]/node_modules/.bin/sentry-wizard"
			}
		},
		"_platforms": [
			"ios",
			"android"
		]
	},
	"shouldConfigurePlatforms": {
		"ios": true,
		"android": true
	},
	"hash": "[hash]",
	"wizard": {
		"apiKeys": {
			"id": "[id]",
			"scopes": [
				"event:admin",
				"event:read",
				"member:read",
				"org:read",
				"project:read",
				"project:releases",
				"team:read",
				"project:write"
			],
			"application": null,
			"expiresAt": null,
			"dateCreated": "2019-10-23T14:06:30.526972Z",
			"state": null,
			"token": "[token]",
			"refreshToken": null
		},
		"projects": [
			{
				"id": "[projectId]",
				"slug": "[slug]",
				"name": "[name]",
				"isPublic": false,
				"isBookmarked": false,
				"color": "#78bf3f",
				"dateCreated": "2019-10-23T13:29:37.454616Z",
				"firstEvent": "2019-10-23T23:21:10.866000Z",
				"firstTransactionEvent": false,
				"features": [
					"alert-filters",
					"issue-alerts-targeting",
					"minidump",
					"race-free-group-creation",
					"similarity-indexing",
					"similarity-view",
					"releases"
				],
				"status": "active",
				"platform": "react-native",
				"isInternal": false,
				"isMember": false,
				"hasAccess": true,
				"avatar": {
					"avatarType": "letter_avatar",
					"avatarUuid": null
				},
				"organization": {
					"id": "[organizationId]",
					"slug": "[name]",
					"status": {
						"id": "active",
						"name": "active"
					},
					"name": "[name]",
					"dateCreated": "2019-10-23T13:28:38.751640Z",
					"isEarlyAdopter": false,
					"require2FA": false,
					"avatar": {
						"avatarType": "letter_avatar",
						"avatarUuid": null
					},
					"features": [
						"team-alerts-ownership",
						"performance-vitals-overview",
						"performance-view",
						"images-loaded-v2",
						"custom-event-title",
						"invite-members-rate-limits",
						"alert-details-redesign",
						"integrations-stacktrace-link",
						"unhandled-issue-flag",
						"symbol-sources",
						"performance-landing-v2",
						"advanced-search",
						"slack-migration",
						"am1-billing",
						"inbox",
						"alert-wizard",
						"org-subdomains",
						"trace-view-summary",
						"open-membership",
						"usage-stats-graph",
						"event-attachments-viewer",
						"shared-issues",
						"event-attachments"
					]
				},
				"keys": [
					{
						"id": "[keyId]",
						"name": "Default",
						"label": "Default",
						"public": "[keyId]",
						"secret": "[secret]",
						"projectId": [projectId],
						"isActive": true,
						"rateLimit": null,
						"dsn": {
							"secret": "https://[keyId]:[secret]@o123456.ingest.sentry.io/[projectId]",
							"public": "https://[keyId]@o123456.ingest.sentry.io/[projectId]",
							"csp": "https://o123456.ingest.sentry.io/api/[projectId]/csp-report/?sentry_key=[keyId]",
							"security": "https://o123456.ingest.sentry.io/api/[projectId]/security/?sentry_key=[keyId]",
							"minidump": "https://o123456.ingest.sentry.io/api/[projectId]/minidump/?sentry_key=[keyId]",
							"unreal": "https://o123456.ingest.sentry.io/api/[projectId]/unreal/[keyId]/",
							"cdn": "https://js.sentry-cdn.com/[keyId].min.js"
						},
						"browserSdkVersion": "5.x",
						"browserSdk": {
							"choices": [
								[
									"latest",
									"latest"
								],
								[
									"6.x",
									"6.x"
								],
								[
									"5.x",
									"5.x"
								],
								[
									"4.x",
									"4.x"
								]
							]
						},
						"dateCreated": "2019-10-23T13:29:37.463474Z"
					}
				]
			}
		]
	}
}


{
	"integration": {
		"_argv": {
			"_": [],
			"debug": true,
			"uninstall": false,
			"skip-connect": false,
			"skipConnect": false,
			"quiet": false,
			"i": "reactNative",
			"integration": "reactNative",
			"p": [
				"ios",
				"android"
			],
			"platform": [
				"ios",
				"android"
			],
			"u": "https://sentry.io/",
			"url": "https://sentry.io/",
			"$0": "[path]/node_modules/.bin/sentry-wizard"
		},
		"_isDebug": true,
		"_sentryCli": {
			"_argv": {
				"_": [],
				"debug": true,
				"uninstall": false,
				"skip-connect": false,
				"skipConnect": false,
				"quiet": false,
				"i": "reactNative",
				"integration": "reactNative",
				"p": [
					"ios",
					"android"
				],
				"platform": [
					"ios",
					"android"
				],
				"u": "https://sentry.io/",
				"url": "https://sentry.io/",
				"$0": "[path]/node_modules/.bin/sentry-wizard"
			}
		},
		"_platforms": [
			"ios",
			"android"
		]
	},
	"shouldConfigurePlatforms": {
		"ios": true,
		"android": true
	},
	"hash": "[hash]",
	"wizard": {
		"apiKeys": {
			"id": "[id]",
			"scopes": [
				"event:admin",
				"event:read",
				"member:read",
				"org:read",
				"project:read",
				"project:releases",
				"team:read",
				"project:write"
			],
			"application": null,
			"expiresAt": null,
			"dateCreated": "2019-10-23T14:06:30.526972Z",
			"state": null,
			"token": "[token]",
			"refreshToken": null
		},
		"projects": [
			{
				"id": "[projectId]",
				"slug": "[slug]",
				"name": "[name]",
				"isPublic": false,
				"isBookmarked": false,
				"color": "#78bf3f",
				"dateCreated": "2019-10-23T13:29:37.454616Z",
				"firstEvent": "2019-10-23T23:21:10.866000Z",
				"firstTransactionEvent": false,
				"features": [
					"alert-filters",
					"issue-alerts-targeting",
					"minidump",
					"race-free-group-creation",
					"similarity-indexing",
					"similarity-view",
					"releases"
				],
				"status": "active",
				"platform": "react-native",
				"isInternal": false,
				"isMember": false,
				"hasAccess": true,
				"avatar": {
					"avatarType": "letter_avatar",
					"avatarUuid": null
				},
				"organization": {
					"id": "[organizationId]",
					"slug": "[name]",
					"status": {
						"id": "active",
						"name": "active"
					},
					"name": "[name]",
					"dateCreated": "2019-10-23T13:28:38.751640Z",
					"isEarlyAdopter": false,
					"require2FA": false,
					"avatar": {
						"avatarType": "letter_avatar",
						"avatarUuid": null
					},
					"features": [
						"team-alerts-ownership",
						"performance-vitals-overview",
						"performance-view",
						"images-loaded-v2",
						"custom-event-title",
						"invite-members-rate-limits",
						"alert-details-redesign",
							"integrations-stacktrace-link",
						"unhandled-issue-flag",
						"symbol-sources",
						"performance-landing-v2",
						"advanced-search",
						"slack-migration",
						"am1-billing",
						"inbox",
						"alert-wizard",
						"org-subdomains",
						"trace-view-summary",
						"open-membership",
						"usage-stats-graph",
						"event-attachments-viewer",
						"shared-issues",
						"event-attachments"
					]
				},
				"keys": [
					{
						"id": "[keyId]",
						"name": "Default",
						"label": "Default",
						"public": "[keyId]",
						"secret": "[secret]",
						"projectId": [projectId],
						"isActive": true,
						"rateLimit": null,
						"dsn": {
							"secret": "https://[keyId]:[secret]@o123456.ingest.sentry.io/[projectId]",
							"public": "https://[keyId]@o123456.ingest.sentry.io/[projectId]",
							"csp": "https://o123456.ingest.sentry.io/api/[projectId]/csp-report/?sentry_key=[keyId]",
							"security": "https://o123456.ingest.sentry.io/api/[projectId]/security/?sentry_key=[keyId]",
							"minidump": "https://o123456.ingest.sentry.io/api/[projectId]/minidump/?sentry_key=[keyId]",
							"unreal": "https://o123456.ingest.sentry.io/api/[projectId]/unreal/[keyId]/",
							"cdn": "https://js.sentry-cdn.com/[keyId].min.js"
						},
						"browserSdkVersion": "5.x",
						"browserSdk": {
							"choices": [
								[
									"latest",
									"latest"
								],
								[
									"6.x",
									"6.x"
								],
								[
									"5.x",
									"5.x"
								],
								[
									"4.x",
									"4.x"
								]
							]
						},
						"dateCreated": "2019-10-23T13:29:37.463474Z"
					}
				]
			}
		]
	},
	"config": {
		"auth": {
			"token": "[token]"
		},
		"dsn": {
			"public": "https://[keyId]@o123456.ingest.sentry.io/[projectId]",
			"secret": "https://[keyId]:[secret]@o123456.ingest.sentry.io/[projectId]"
		},
		"organization": {
			"slug": "[name]"
		},
		"project": {
			"slug": "[slug]"
		}
	}
}


ios/sentry.properties not exists


android/sentry.properties not exists


ios/sentry.properties not exists


android/sentry.properties not exists

✅ Patched build.gradle file.
Error: No platform selected
    at ReactNative.MobileProject.getPlatforms ([path]/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/MobileProject.js:65:19)
    at ReactNative._patchJs ([path]/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/ReactNative.js:224:14)
    at [path]/node_modules/@sentry/wizard/dist/lib/Helper/File.js:28:45
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
    at Object.writeFileSync (node:fs:1528:5)
    at [path]/node_modules/@sentry/wizard/dist/lib/Helper/File.js:33:20
    at processTicksAndRejections (node:internal/process/task_queues:94:5)

{
	"integration": {
		"_argv": {
			"_": [],
			"debug": true,
			"uninstall": false,
			"skip-connect": false,
			"skipConnect": false,
			"quiet": false,
			"i": "reactNative",
			"integration": "reactNative",
			"p": [
				"ios",
				"android"
			],
			"platform": [
				"ios",
				"android"
			],
			"u": "https://sentry.io/",
			"url": "https://sentry.io/",
			"$0": "[path]/node_modules/.bin/sentry-wizard"
		},
		"_isDebug": true,
		"_sentryCli": {
			"_argv": {
				"_": [],
				"debug": true,
				"uninstall": false,
				"skip-connect": false,
				"skipConnect": false,
				"quiet": false,
				"i": "reactNative",
				"integration": "reactNative",
				"p": [
					"ios",
					"android"
				],
				"platform": [
					"ios",
					"android"
				],
				"u": "https://sentry.io/",
				"url": "https://sentry.io/",
				"$0": "[path]/node_modules/.bin/sentry-wizard"
			}
		},
		"_platforms": [
			"ios",
			"android"
		]
	},
	"shouldConfigurePlatforms": {
		"ios": true,
		"android": true
	},
	"hash": "[hash]",
	"wizard": {
		"apiKeys": {
			"id": "[id]",
			"scopes": [
				"event:admin",
				"event:read",
				"member:read",
				"org:read",
				"project:read",
				"project:releases",
				"team:read",
				"project:write"
			],
			"application": null,
			"expiresAt": null,
			"dateCreated": "2019-10-23T14:06:30.526972Z",
			"state": null,
			"token": "[token]",
			"refreshToken": null
		},
		"projects": [
			{
				"id": "[projectId]",
				"slug": "[slug]",
				"name": "[name]",
				"isPublic": false,
				"isBookmarked": false,
				"color": "#78bf3f",
				"dateCreated": "2019-10-23T13:29:37.454616Z",
				"firstEvent": "2019-10-23T23:21:10.866000Z",
				"firstTransactionEvent": false,
				"features": [
					"alert-filters",
					"issue-alerts-targeting",
					"minidump",
					"race-free-group-creation",
					"similarity-indexing",
					"similarity-view",
					"releases"
				],
				"status": "active",
				"platform": "react-native",
				"isInternal": false,
				"isMember": false,
				"hasAccess": true,
				"avatar": {
					"avatarType": "letter_avatar",
					"avatarUuid": null
				},
				"organization": {
					"id": "[organizationId]",
					"slug": "[name]",
					"status": {
						"id": "active",
						"name": "active"
					},
					"name": "[name]",
					"dateCreated": "2019-10-23T13:28:38.751640Z",
					"isEarlyAdopter": false,
					"require2FA": false,
					"avatar": {
						"avatarType": "letter_avatar",
						"avatarUuid": null
					},
					"features": [
						"team-alerts-ownership",
						"performance-vitals-overview",
						"performance-view",
						"images-loaded-v2",
						"custom-event-title",
						"invite-members-rate-limits",
						"alert-details-redesign",
						"integrations-stacktrace-link",
						"unhandled-issue-flag",
						"symbol-sources",
						"performance-landing-v2",
						"advanced-search",
						"slack-migration",
						"am1-billing",
						"inbox",
						"alert-wizard",
						"org-subdomains",
						"trace-view-summary",
						"open-membership",
						"usage-stats-graph",
						"event-attachments-viewer",
						"shared-issues",
						"event-attachments"
					]
				},
				"keys": [
					{
						"id": "[keyId]",
						"name": "Default",
						"label": "Default",
						"public": "[keyId]",
						"secret": "[secret]",
						"projectId": [projectId],
						"isActive": true,
						"rateLimit": null,
						"dsn": {
							"secret": "https://[keyId]:[secret]@o123456.ingest.sentry.io/[projectId]",
							"public": "https://[keyId]@o123456.ingest.sentry.io/[projectId]",
							"csp": "https://o123456.ingest.sentry.io/api/[projectId]/csp-report/?sentry_key=[keyId]",
							"security": "https://o123456.ingest.sentry.io/api/[projectId]/security/?sentry_key=[keyId]",
							"minidump": "https://o123456.ingest.sentry.io/api/[projectId]/minidump/?sentry_key=[keyId]",
							"unreal": "https://o123456.ingest.sentry.io/api/[projectId]/unreal/[keyId]/",
							"cdn": "https://js.sentry-cdn.com/[keyId].min.js"
						},
						"browserSdkVersion": "5.x",
						"browserSdk": {
							"choices": [
								[
									"latest",
									"latest"
								],
								[
									"6.x",
									"6.x"
								],
								[
									"5.x",
									"5.x"
								],
								[
									"4.x",
									"4.x"
								]
							]
						},
						"dateCreated": "2019-10-23T13:29:37.463474Z"
					}
				]
			}
		]
	},
	"config": {
		"auth": {
			"token": "[token]"
		},
		"dsn": {
			"public": "https://[keyId]@o123456.ingest.sentry.io/[projectId]",
			"secret": "https://[keyId]:[secret]@o123456.ingest.sentry.io/[projectId]"
		},
		"organization": {
			"slug": "[name]"
		},
		"project": {
			"slug": "[slug]"
		}
	}
}


🎉  Successfully set up Sentry for your project 🎉