Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Self-hosted/on-premise
Which package are you using?
@sentry/vue
SDK Version
7.7.0
Framework Version
vue 2.5.17
Link to Sentry event
No response
Steps to Reproduce
All application render is cancelled.
in the file node_modules\@sentry\vue\esm\tracing.js
, i find that all const
are replaced by var
after building.
but var
does not have block scope, which may cause some problems like this:
let mixins = [];
for(var i of [0, 1, 2]){
mixins[i] = ()=> console.log(i);
}
mixins.forEach(func=>func())
// unexpected result:2 2 2
mixins = [];
for(const i of [0, 1, 2]){
mixins[i] = ()=> console.log(i);
}
mixins.forEach(func=>func())
// expected result:0 1 2
span does not finish because highlight part code never work。
Solution:
-
use
let
to declare variables, to avoid to be replaced; -
adjust rollup build config
sentry-javascript\rollup\plugins\npmPlugins.js
makeConstToVarPlugin()
Expected Result
ui.vue span can finish correctly
Actual Result
ui.vue span work in wrong way