gpt4 book ai didi

heroku - 使用 @sentry/webpack-plugin 和 heroku 的 Sentry

转载 作者:行者123 更新时间:2023-12-01 04:28:52 32 4
gpt4 key购买 nike

我正在使用 webpack 构建我的应用程序,它可以在本地使用 @sentry/webpack-plugin – 它自动生成发布并将源 map 上传到 Sentry。

但是,如果我尝试在 Heroku 上构建相同的应用程序,则会出现以下错误:

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)

我究竟做错了什么?

最佳答案

您可以通过在插件配置中手动指定发布名称来解决此问题:

const version = require('../VERSION').version;

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

我们使用一个名为 release-it 的模块当我们运行 npm run release 时构建一个 VERSION 文件.这是 .release-it.json我们为此使用的配置文件:
{
"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}"
}
}

关于heroku - 使用 @sentry/webpack-plugin 和 heroku 的 Sentry ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55710718/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com