首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用@ Sentry /webpack的sentry-插件和heroku

使用@ Sentry /webpack的sentry-插件和heroku
EN

Stack Overflow用户
提问于 2019-04-16 22:36:12
回答 2查看 1.1K关注 0票数 4

我正在使用webpack来构建我的应用程序,它在本地使用@sentry/webpack-plugin -它会自动生成发布并将源地图上传到前哨。

然而,如果我试图在Heroku上构建相同的应用程序,它会给我以下错误:

代码语言:javascript
复制
Error: Command failed: /tmp/build_e3ae44a78c063d6493d3fdfc983bd8d6/client/node_modules/@sentry/cli/sentry-cli releases propose-version
  INFO    2019-04-16 13:33:13.141611957 +00:00 Loaded config from /tmp/build_e3ae44a78c063d6493d3fdfc983bd8d6/client/.sentryclirc
  DEBUG   2019-04-16 13:33:13.141666891 +00:00 sentry-cli version: 1.41.0, platform: "linux", architecture: "x86_64"
  INFO    2019-04-16 13:33:13.141684793 +00:00 sentry-cli was invoked with the following command line: "/tmp/build_e3ae44a78c063d6493d3fdfc983bd8d6/client/node_modules/@sentry/cli/sentry-cli" "releases" "propose-version"
  DEBUG   2019-04-16 13:33:13.141916192 +00:00 error: running update nagger
  DEBUG   2019-04-16 13:33:13.141939514 +00:00 skipping update nagger because session is not attended
error: Could not automatically determine release name
  DEBUG   2019-04-16 13:33:13.142576118 +00:00 client close; no transport to shut down  (from sentry)
    at ChildProcess.exithandler (child_process.js:289:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Socket.stream.socket.on (internal/child_process.js:381:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close (net.js:606:12)

我做错了什么?

EN

回答 2

Stack Overflow用户

发布于 2019-10-30 07:10:40

您可以通过在插件配置中手动指定版本名称来修复此问题:

代码语言:javascript
复制
const version = require('../VERSION').version;

webpackConfig.plugins.push(new SentryWebpackPlugin({
  include: '../src',
  ignoreFile: '.sentrycliignore',
  ignore: ['node_modules', 'webpack.config.js'],
  configFile: '.sentryclirc',
  release: version
}));

在运行npm run release时,我们使用一个名为release-it的模块来构建一个版本文件。下面是我们使用的.release-it.json配置文件:

代码语言:javascript
复制
{
  "non-interactive": true,
  "npm": {
    "publish": false
  },
  "use": "git.tag",
  "pkgFiles": null,
  "scripts": {
    "afterBump": "echo module.exports = {version: \"'\"${version}\"'\"} > $(git rev-parse --show-toplevel)/VERSION"
  },
  "git": {
    "commitMessage": "release: v${version}",
    "requireCleanWorkingDir": false,
    "tagName": "v${version}"
  }
}
票数 1
EN

Stack Overflow用户

发布于 2019-09-23 18:40:36

我也有同样的问题,当我建立一个缓慢的互联网连接。此外,请检查您正在使用的API令牌在https://sentry.io/settings/account/api/auth-tokens/中是否具有写入权限

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55710718

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档