{
url: 'https://xxx
project: 'xxx',
authToken,
org: 'sentry',
sourcemaps: {
filesToDeleteAfterUpload: 'dist/assets/*.map',
},
release: {
name: 'v1.0.0',
deploy: {
env: 'production',
},
uploadLegacySourcemaps: [
{
urlPrefix: '~/assets/',
ignore: ['./node_modules'],
paths: ['dist/assets'],
},
],
},
debug: true,
};
log 显示 已经上传成功 后台也能看到相应的 sourceMap 但是报错的时候不显示具体的报错行数是怎么回事
1
zzjjhh001 34 天前
能确定线上静态资源的访问路径,和 urlPrefix 配置的路径一致么?
有的静态资源都喜欢加点前缀啥的 |
2
SHEN22 OP @zzjjhh001 http://xxx.com/assets/* 通过这样访问我是能访问到资源的 应该就没问题吧
|
3
zzjjhh001 34 天前
是的,可以本地试下生成的 sourcemap 文件有没有问题
gpt 代码 仅供参考 const { SourceMapConsumer } = require('source-map'); const fs = require('fs'); async function lookup() { const mapObj = JSON.parse(fs.readFileSync('app.min.js.map', 'utf8')); const consumer = await new SourceMapConsumer(mapObj); const pos = consumer.originalPositionFor({ line: 1234, column: 56 }); console.log(pos); // { source, line, column, name } consumer.destroy(); } lookup(); |