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

[User Feedback] Feedback button is not attached to DOM, when it is initialized while DOCUMENT is still loading #12970

Closed
3 tasks done
jaspreet57 opened this issue Jul 18, 2024 · 5 comments · Fixed by #12973
Closed
3 tasks done
Labels
Package: vue Issues related to the Sentry Vue SDK Type: Bug

Comments

@jaspreet57
Copy link
Contributor

jaspreet57 commented Jul 18, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/vue

SDK Version

8.18.0

Framework Version

2.6.12

Link to Sentry event

No response

SDK Setup/Reproduction Example

import Vue from 'vue'
import * as Sentry from '@sentry/vue'

Sentry.init({
  Vue,
  dsn: ...,
  release: ...,

  replaysSessionSampleRate: 0.01,
  replaysOnErrorSampleRate: 1.0,
  integrations: [
    Sentry.replayIntegration({
      maskAllText: false,
      blockAllMedia: false,
      mask: ['.sentry-mask, [data-sentry-mask]']
    }),
    Sentry.feedbackIntegration({
      // Additional SDK configuration goes in here, for example:
      colorScheme: 'system',
    })
  ]
})

It is a basic setup. Only difference here is that I am using Nuxt, in which when Sentry.init is called, during that time
DOCUMENT.readyState is still equal to 'loading'.

And I have already found that there is a Bug in packages/feedback/src/core/integration.ts. And bug is that appendToDom method is not called.

Fix will be : (I tested it already and it is working)
Screenshot 2024-07-18 at 12 24 57 PM

Steps to Reproduce

  1. Add @sentry/vue in nuxt (vue) app.
  2. Use it as a plugin in Nuxt.
  3. Start the app

Expected Result

User Feedback button should be visible in the application regardless of when it is initialized.

Actual Result

User Feedback button is not visible.

@github-actions github-actions bot added the Package: vue Issues related to the Sentry Vue SDK label Jul 18, 2024
@andreiborza
Copy link
Member

Hello @jaspreet57, thanks for filing this and providing how to fix it :)

Is this something you maybe would like to contribute yourself via a PR? If not, we'd happily do it, just let us know.

@jaspreet57
Copy link
Contributor Author

Thanks @andreiborza for a quick reply. Yes I am working on it. I will try to raise a PR soon, if I am able to meet the contribution requirements and pass the test cases. Else I will let you know by EOD.

@andreiborza
Copy link
Member

@jaspreet57 great! Feel free to ask for help or skip parts you can't figure out.

@jaspreet57
Copy link
Contributor Author

@andreiborza I have raised a PR.

This line is not covered by any of the existing unit test cases. I guess this line will be covered in e2e or browser-integration-tests. I couldn't run e2e tests yet.

can I skip test cases if sentry team can write that later? I need this fix sooner in my Nuxt project.

@andreiborza
Copy link
Member

@jaspreet57 thanks, taking a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: vue Issues related to the Sentry Vue SDK Type: Bug
Projects
Archived in project
2 participants