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

Event: Non-Error promise rejection captured with keys: currentTarget, detail, isTrusted, target #6199

Closed
3 tasks done
karolina-szlenk opened this issue Nov 14, 2022 · 13 comments

Comments

@karolina-szlenk
Copy link

karolina-szlenk commented Nov 14, 2022

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which package are you using?

@sentry/nextjs

SDK Version

7.5.0

Framework Version

React 17.0.2
Next 12.2.4

Link to Sentry event

No response

Steps to Reproduce

Can't reproduce.

I can't reproduce the issue anywhere: locally and on dev or production on my machine (Windows 10).

Expected Result

Working app without the issue. Error should be handled.

Actual Result

Currently, I can see some issues in my sentry report. They happen only on Mac.
Places, where it occurs on the app is random. Actually, it happens everywhere.

ADDITIONAL DATA

__serialized__ 
{
  "currentTarget":"[object Window]",
  "detail":null,
  "isTrusted":false,
  "target":"[object Window]",
  "type":"unhandledrejection"
}

The screenshot of report:
image

@Lms24
Copy link
Member

Lms24 commented Nov 14, 2022

Hi @karolina-szlenk thanks for writing in.

Can you tell me a little bit more about what the problem is? I'm not sure if I understand it correctly. Are errors not captured by our SDK? Do you get some sort of error message? Or is there data missing in a error?

Thanks

@karolina-szlenk
Copy link
Author

@Lms24 Thanks for your response. My answers:
Are errors not captured by our SDK?
Errors are captured by your SDK. But they are not the error that comes from the application code.

Do you get some sort of error message?
I can't reproduce it, but I see a bunch of these errors in my sentry report. Each of them looks the same
image

Or is there data missing in a error?
All data related to error I attached in the description. Section -> Actual Result.

@Lms24
Copy link
Member

Lms24 commented Nov 14, 2022

Can you tell me when this happens exactly? For instance, as soon as you open the app in a browser or even before that? Since we're talking about Next.JS, does it happen on the server or client side?

Generally, such an error is captured by our SDK, if a promise is rejected and this bubbles up to the global onUnhandledRejection handler. (Sentry instruments this handler by default). Any chance that you're using a library that throws/rejects (or maybe something for network requests)?

@karolina-szlenk
Copy link
Author

There is no one moment when it happens. But usually if a user are searching through the app, suddently the error occurs. Just in random moments. It is client side.
Hm, interesting. I do not use any specific library. I use try/catch where I throw/reject errors.
Do you suggest me something, maybe?

@Lms24
Copy link
Member

Lms24 commented Nov 14, 2022

It's very hard for us to pinpoint this. My best guess would be that you have some promise in your app that rejects and isn't caught. My best advice would be to try to narrow it down from your end and build a minimal reproduction. If you manage to find under which conditions this appears chances are that you find the problem.

I'm btw not saying that this isn't a bug in the SDK or anything. It could very well be a bug. We just need a reproduction and more information to find it.

Since it seems you have access to breadcrumbs, maybe you can find out what happened before the exception.

I hope this helps a little!

@karolina-szlenk
Copy link
Author

@Lms24 I really appreciate your commitment.

Regarding to your advise, I went through events and their breadcrumbs. The exception is preceded by bunch of API calls, but all with status code: 200. Althought there is no common point for these events, I picked one of them and followed exactly the same steps as in the breadcrumbs. I couldn't reproduce the error.

But looking at report I've noticed that the error happens only on one type of device: Mac OS X. Have you ever met that any specific problem does appear only for this one?

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

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 🥀

@Lms24
Copy link
Member

Lms24 commented Dec 19, 2022

Hi @karolina-szlenk, apologies, this one slipped through my radar. Is this still an issue for you? If yes, I'll reopen the issue.

I have a couple more ideas:

  • Since you said this is seems to be MacOS/Safari-specific: Maybe this is caused by a browser extension or some 3rd party JS of some users? You might find a hint about this in the stack trace
  • On the same note, we've observed numerous occasions where weird unexplicable errors happened because of bots/crawlsers (e.g. Massive issue influx from single client #6287). Maybe this happened here?
  • Is there any hint in the stacktrace as to where these errors might originate from?

@andreasvirkus
Copy link

andreasvirkus commented Mar 29, 2023

Also happening for us, but not macOS or safari specific (Sentry also reports this for Windows 10 users on Chrome 111.0.0). It's not a crawler influx for us most likely as the events are spread out pretty evenly 🤔

Screenshot 2023-03-29 at 12 08 03

We've also gone through #2546 and https://docs.sentry.io/platforms/javascript/troubleshooting/#events-with-non-error-exception

@andreasvirkus
Copy link

@Lms24 worth reopening? 🙏

@Lms24
Copy link
Member

Lms24 commented Apr 11, 2023

@andreasvirkus I don't yet think there's a lot we can do here in terms of default SDK behaviour. I read up on #2546 and it seems like this might very well be related to a failed script load (e.g. because of ad blockers).

If you don't want to capture this error, you should be able to filter it out in beforeSend. Does this solve the issue for you?

@gocarlos
Copy link

@andreasvirkus I don't yet think there's a lot we can do here in terms of default SDK behaviour. I read up on #2546 and it seems like this might very well be related to a failed script load (e.g. because of ad blockers).

If you don't want to capture this error, you should be able to filter it out in beforeSend. Does this solve the issue for you?

@Lms24 can you provide some example code? this issue seems to be affecting multiple people, would be great for all of us to have a quick way of getting rid of it

@Lms24
Copy link
Member

Lms24 commented Apr 25, 2023

@gocarlos see my answer here. You might need to change the error message but the idea should be similar.

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

No branches or pull requests

4 participants