Skip to content

Log warning if Vue app is mounted before Sentry.init is called #6226

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

Closed
Lms24 opened this issue Nov 17, 2022 · 0 comments · Fixed by #6227
Closed

Log warning if Vue app is mounted before Sentry.init is called #6226

Lms24 opened this issue Nov 17, 2022 · 0 comments · Fixed by #6227
Assignees
Labels
Meta: Help Wanted Package: vue Issues related to the Sentry Vue SDK Type: Improvement

Comments

@Lms24
Copy link
Member

Lms24 commented Nov 17, 2022

Problem Statement

As explained in our Vue docs, Sentry.init should be called before a Vue 2 or 3 app is mounted (app.mount("#app")). The reason is that our SDK needs to initialize itself and instrument various handlers before the actual Vue app is bootstrapped. If this happens in the opposite order, Sentry cannot detect errors that happen during mounting.

Solution Brainstorm

We need some way to check in Sentry.init if the app object (which we pass to the init function) was already mounted. Perhaps this object has some property that is changed on mount or we could check for hooks in some way. Not yet sure.

This is not high-prio but it'd be nice to have when we get to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meta: Help Wanted Package: vue Issues related to the Sentry Vue SDK Type: Improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants