Sentry's sourcemaps/artifacts don't work

拥有回忆 提交于 2019-12-05 12:31:53

I posted this question at forum.sentry.io and got the answer from a guy called @benvinegar.

Here is the thing: when sending a sourcemap/artifact, we provide the file and also a filename. The filename is meant to be the complete URL where the sourcemap would be located if it was uploaded to the host together with the minified JS files. That is: if our minified Javascript is located at www.example.com/js/app.js, then the sourcemap/artifact filename must be www.example.com/js/app.js.map. Otherwise, we can name it ~/js/app.js.map if we want the sourcemap to apply to other situations like running the app at localhost:8080/js/app.js.

As I'm using webpack-sentry-plugin, it was just a matter of adding the following property to the plugin:

{
  plugins: [
    new SentryPlugin({
      filenameTransform: filename => '~/' + filename
    })
  ]
}

In our case, it hasn't been working for a loooong time.

Everything seems to be just fine. Artifacts uploaded, versions tagged, errors logged, but no sourcemaps.

Bottom line of the issue: We are hosting Sentry ourselves and sentry is divided into different containers. They did not properly share the data.

One solution is to share the data between containers (see that post) or to even upload your sourcemaps to an S3 server and Sentry can also work with that.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!