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

Angular error when adding a screenshot in user feedback dialog #12713

Closed
3 tasks done
Grandmac opened this issue Jul 1, 2024 · 9 comments
Closed
3 tasks done

Angular error when adding a screenshot in user feedback dialog #12713

Grandmac opened this issue Jul 1, 2024 · 9 comments

Comments

@Grandmac
Copy link

Grandmac commented Jul 1, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/angular

SDK Version

8.13.0

Framework Version

Angular 17 and 18

Link to Sentry event

https://cgr-sentry.sentry.io/share/issue/ca485e374ad24ae8ba6692ead3d39a0d/

SDK Setup/Reproduction Example

Angular 17 https://stackblitz.com/edit/angular-17-starter-project-rjdi4h?file=src%2Fmain.ts
Angular 18 https://stackblitz.com/edit/stackblitz-starters-qzpdva?file=src%2Fmain.ts

Steps to Reproduce

Add Sentry.feedbackIntegration({}) to Sentry.init integrations section, open the feedback integration and try to do a screenshot with the "add a screenshot" button

Expected Result

Add a screenshot to the user feedback

Actual Result

Error in console

preview-b991ddc586eca.js:2 ReferenceError: h is not defined
at b$1.CropCorner [as constructor] (ScreenshotEditor.tsx:341:32)
at b$1.q$1 [as render] (preact.mjs:1:9009)
at M (preact.mjs:1:6532)
at P$1 (preact.mjs:1:1961)
at z$1 (preact.mjs:1:8257)
at M (preact.mjs:1:7079)
at P$1 (preact.mjs:1:1961)
at z$1 (preact.mjs:1:8257)
at M (preact.mjs:1:7079)
at P$1 (preact.mjs:1:1961)
at z$1 (preact.mjs:1:8257)
at M (preact.mjs:1:7079)
at P$1 (preact.mjs:1:1961)
at M (preact.mjs:1:6746)
at P$1 (preact.mjs:1:1961)
at z$1 (preact.mjs:1:8257)
at M (preact.mjs:1:7079)
at P$1 (preact.mjs:1:1961)
at M (preact.mjs:1:6746)
at w$1 (preact.mjs:1:1110)
at C$1 (preact.mjs:1:1626)
at _ZoneDelegate.invoke (zone.umd.js:411:30)
at Zone.run (zone.umd.js:165:47)
at eval (zone.umd.js:1314:38)
at _ZoneDelegate.invokeTask (zone.umd.js:445:35)
at Zone.runTask (zone.umd.js:210:51)
at drainMicroTaskQueue (zone.umd.js:634:39)
at ZoneTask.invokeTask [as invoke] (zone.umd.js:531:25)
at invokeTask (zone.umd.js:1705:22)
at globalCallback (zone.umd.js:1748:35)
at HTMLButtonElement.globalZoneAwareCallback (zone.umd.js:1772:20)

@github-actions github-actions bot added the Package: angular Issues related to the Sentry Angular SDK label Jul 1, 2024
@bruno-garcia
Copy link
Member

Thanks for raising.
The minified frames will make it challenging I imagine, this is where it points to at least we can see in the stack trace you shared:

https://github.com/getsentry/sentry-javascript/blob/8.13.0/packages/feedback/src/screenshot/components/ScreenshotEditor.tsx#L351

@GautheyValentin
Copy link

The package @sentry/nextjs have the same issue
(Same trace than the opener)

@mydea
Copy link
Member

mydea commented Jul 4, 2024

We'll take a look!

@nissan
Copy link

nissan commented Jul 4, 2024

Also having the issue within a NextJS app, the error occurs when I click on the "Add Screenshot" button only though, otherwise it does work.

@vogelino
Copy link

vogelino commented Jul 5, 2024

I'm having the same issue when clicking on the "Add Screenshot" button:

My packages:
Next: 14.1.0
@sentry/nextjs: 8.14.0

Error:

ReferenceError: h is not defined

@andreiborza
Copy link
Member

Thanks for reporting this, it's also broken in react. I'll take a look at this.

@Ishuboi07
Copy link

Having this issue in nextjs with the newer version, it was working in the older version

@andreiborza
Copy link
Member

We are working on it, see #12784 for a status.

@ryan953 ryan953 self-assigned this Jul 8, 2024
ryan953 added a commit that referenced this issue Jul 8, 2024
…12784)

This broke the `Add a screenshot` button on the user feedback, see
#12713

This has been explicitly removed in favor of injecting `h` in
#12535 but at that
point it seems to be too late to do.

Co-authored-by: Ryan Albrecht <ryan.albrecht@sentry.io>
@Grandmac
Copy link
Author

Grandmac commented Jul 9, 2024

Thank you all, it's resolved in version 8.16.0 🎉

@Grandmac Grandmac closed this as completed Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

10 participants