Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: sentry sourcemap can't locate the right position in sourcemap in vue error stack #3335

Closed
sbyps opened this issue Sep 1, 2024 · 4 comments
Labels
🐞 bug Something isn't working

Comments

@sbyps
Copy link

sbyps commented Sep 1, 2024

Version

System:
    OS: macOS 14.6.1
    CPU: (11) arm64 Apple M3 Pro
    Memory: 39.80 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 128.0.6613.114
    Safari: 17.6
  npmPackages:
    @rsbuild/core: ^1.0.1-rc.0 => 1.0.1-rc.0 
    @rsbuild/plugin-check-syntax: ^1.0.1 => 1.0.1 
    @rsbuild/plugin-sass: ^1.0.1-rc.0 => 1.0.1-rc.0 
    @rsbuild/plugin-vue2: ^1.0.1-rc.0 => 1.0.1

Details

vue2.7 rsbuild 配置 output.sourceMap: 'source-map'
当 vue 上下文中发生报错时,sentry sourcemap 不能定位到准确位置;js jsx ts tsx 中报错可以定位到准确位置;使用 vue-cli 的也可以定位到准确位置;
使用https://sourcemaps.io/进行检查含有vue 代码的 sourcemap提示不匹配,检查 js 如 lib-axios、lib-vue 的 sourcemap 能够匹配;
其他的一个报错:
image
image

Reproduce link

https://github.com/sbyps/rspack-demo

Reproduce Steps

npm run build
上传 sourcemap 到 sentry 服务器
访问网页、发现报错,查看 sentry issue,发现报错信息不能匹配
使用https://sourcemaps.io/进行检查record-replay.js.map也提示不匹配;
检查 lib-vue.js.map能够匹配

@sbyps sbyps added the 🐞 bug Something isn't working label Sep 1, 2024
@chenjiahan
Copy link
Member

I tried a Vue 2 demo and the source map worked as expected:

image

I have also tried the demo, uploading the source map to https://evanw.github.io/source-map-visualization/, and cannot find an invalid source map:

image

@sbyps
Copy link
Author

sbyps commented Sep 5, 2024

@chenjiahan this case is for error stack matches invalid location in sourcemap, can be found in sourcemap;
in demo, throw an error in vue created, but it canot matches sourcemap in right location lines

@chenjiahan
Copy link
Member

I tried to throw an error in the Vue created() and Chrome devtools can parse the source map as expected in both development and production mode:

image

image

@yuantongkang
Copy link

beta 版本不行,试了最新的 rc-4 可以了

@sbyps sbyps closed this as completed Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants