expo / sentry-expo

MIT License
202 stars 83 forks source link

ios: sentry-expo: Unable to modify build script 'Bundle React Native code and images'. (only with yarn) #310

Closed maoryadin closed 1 year ago

maoryadin commented 1 year ago

Summary

while trying to execute "expo prebuild" I am getting this error:

ios: sentry-expo: Unable to modify build script 'Bundle React Native code and images'. Please open a bug report at https://github.com/expo/sentry-expo.

work fine with npm expo build

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android, iOS

SDK Version (managed workflow only)

45.0.0

Environment

yarn version: 1.22.5 "@sentry/react-native@^3.1.1":version "3.4.3" sentry-expo@^4.2.0:version "4.2.0"

npm version: 6.14.13 with "expo prebuild --npm" its works fine

Reproducible demo or steps to reproduce from a blank project

just use yarn to do expo prebuild. make sure you have my env installed as attached above.

juspeeh commented 1 year ago

Having same issue

"expo": "~47.0.12" "sentry-expo": "~6.0.0", "@sentry/react-native": "4.9.0"

volkish commented 1 year ago

Same

"expo": "~47.0.12", "sentry-expo": "~6.0.0" "@sentry/react-native": "4.9.0",

ci-vamp commented 1 year ago

same issue

"expo": "~47.0.12",
"sentry-expo": "~6.0.0",
"@sentry/react-native": "4.9.0"
raulsanchez1024 commented 1 year ago

Same issue

"expo": "^48.0.10",
"sentry-expo": "~6.1.0",
"@sentry/react-native": "4.13.0",

Has anyone got sentry-expo working for Expo SDK >47?

MaxInMoon commented 1 year ago

Anyone did find a fix ??

raulsanchez1024 commented 1 year ago

Ok, after days of being stuck on this issue, I finally found my problem. I never created a SENTRY_AUTH_TOKEN env variable 🤦‍♂️

@MaxInMoon

ansh commented 1 year ago

I was facing this issue when running expo run:ios locally instead of taking a build from EAS build.

I fixed it by putting SENTRY_AUTH_TOKEN in eas.json as described in the docs: https://docs.expo.dev/build-reference/variables/#accessing-secrets-in-eas-build

ansh commented 1 year ago

I was facing this issue when running expo run:ios locally instead of taking a build from EAS build.

I fixed it by putting SENTRY_AUTH_TOKEN in eas.json as described in the docs: https://docs.expo.dev/build-reference/variables/#accessing-secrets-in-eas-build

tacsotai commented 1 year ago

Same on M1 mac with social-app build.

social-app % npx expo prebuild
✔ Created native projects | /android, /ios already created | gitignore skipped
› Metro skipped: Project metro.config.js does not match prebuild template.
› Ensure the project uses expo/metro-config.
  Learn more
✔ Updated package.json and added index.js entry point for iOS and Android
› Installing using yarn
> yarn install
» ios: sentry-expo: Unable to modify build script 'Bundle React Native code and images'. Please open a bug report at https://github.com/expo/sentry-expo.
✔ Config synced
ALFmachine commented 1 year ago

I ran into this as well and was able to resolve and continue to iterate by adding the --clean flag

image
kbrandwijk commented 1 year ago

It seems the issues in this thread were either resolved by specifying the SENTRY_AUTH_TOKEN env var or by performing a clean prebuild. As there's nothing actionable left, I'm going to close this issue. Feel free to open a new issue if you're still having issues.

bj97301 commented 1 year ago

I am seeing this after migrating to prebuild. I have SENTRY_AUTH_TOKEN and ~/.sentryclirc but still get this error. I also did a clean. Any ideas?

ALFmachine commented 1 year ago

I am seeing this after migrating to prebuild. I have SENTRY_AUTH_TOKEN and ~/.sentryclirc but still get this error. I also did a clean. Any ideas?

two things you can try that helped me:

alex-vault commented 9 months ago

Note that even though the SENTRY_AUTH_TOKEN is only used for the postPublish hook, it will break normal local code generation such as during npx expo prebuild --clean if it isn't set. It appears that you can work around this by setting SENTRY_AUTH_TOKEN to even an empty string when building locally for development.