Skip to content

ui.vue application render is always cancelled #5917

Closed
@jinhao-c

Description

@jinhao-c

Is there an existing issue for this?

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

image

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

image

span does not finish because highlight part code never work。

Solution:

  1. use let to declare variables, to avoid to be replaced;

  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: vueIssues related to the Sentry Vue SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions