expo / sentry-expo

MIT License
202 stars 83 forks source link

Is there a guide on how to generate/upload sourcemaps when running eas build? #376

Closed wilmxre closed 6 months ago

wilmxre commented 9 months ago

As i mentioned in the title, i am curious if there is a well-documented and battle-tested guide on this, because i think people can get confused. The expo documentation although is very detailed, i didn't find a good solution for eas build.

Currently what works for me is creating a new build with eas build then running eas update to generate the dist folder for the bundles. But then it gets kinda messy, especially for the developer who is accustomed to the expo ecosystem, you have to rename the bundle files (especially if you are using hermes), then run a long sentry-cli command to upload the sourcemaps to that given release and even then sometimes it will not work.

I don't think this is very intuitive, so i am curious if there is or will be some updates on this in the future, maybe better documentation or a simplified process to generate the sourcemaps and assign it to your build.

I want to mention that i am grateful for the expo team, it made the development in react native tremendously easier, i just wanted to get some information on this.

kliakhovskii-brex commented 8 months ago

Would second it, we recently switched from expo publish to eas updates, and while the doc has descriptions on renaming the files and scripts, it took us ~3-4 iterations to implement properly. Comparing it to DX of postPublish hook as it used to be, it feels like a step back.

I assume this is more on eas update side of things at this moment If it'll support similar workflow to postPublish hook, then there shouldn't be any burden on engineers to deal with this.

It's tracked in here I suppose

paule89123 commented 8 months ago

Sourcemaps aren't even uploading for me when running expo publish. Anyone else have this issue? The end of my expo publish says:

Running postPublish hook: sentry-expo/upload-sourcemaps
...
Error uploading sourcemaps to Sentry: spawn ...

My app.json is setup correctly:

{
  "expo": {
    // ...other stuff
    "hooks": {
      "postPublish": [
        {
          "file": "sentry-expo/upload-sourcemaps",
          "config": {
            "organization": "[redacted]",
            "project": "[redacted]"
          }
        }
      ]
    }
  }
}

and I've configured SENTRY_AUTH_TOKEN in Eas Secrets. I can't see what I'm missing.

krystofwoldrich commented 6 months ago

Hello everyone, @sentry/react-native now supports Expo out of the box!

Guide on how to set up source maps: https://docs.sentry.io/platforms/react-native/sourcemaps/uploading/expo/

Update to https://github.com/getsentry/sentry-react-native/releases/tag/5.16.0 or newer to get all the new features.

Migration guides available:

wilmxre commented 6 months ago

thanks @krystofwoldrich for the sentry team that made this possible!