Skip to content

ui.vue application render is always cancelled #5917

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

Activity

  1. lforst commented on Oct 10, 2022

    @lforst
    Contributor

    Thanks for writing in! The conversion from const to var is indeed a bit dangerous and we'll discuss internally if we're going to keep it.

    As for the span being cancelled, we're not sure if the issues are related because in theory the spans should enter the code branch you marked red, otherwise we would never even start a span.

    We started working on #5693 anyways so a fix for that might actually resolve this issue too.

  2. Lms24 commented on Oct 17, 2022

    @Lms24
    Member

    Update: Our investigation today revealed that the const->var conversion is also responsible for child component spans not being tracked in Vue 2 apps: #5925

  3. lforst commented on Oct 19, 2022

    @lforst
    Contributor

    @jinhao-c Hi, we removed the const-to-var transformation and released the change in version 7.16.0 of the SDK. Would you mind trying out the new version and reporting back whether it fixed the issue for you?

  4. github-actions commented on Nov 10, 2022

    @github-actions
    Contributor

    This issue has gone three weeks without activity. In another week, I will close it.

    But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


    "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions