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

Next. js version 12.3.4, invalid server report, no errors collected;"@sentry/nextjs": "8.13.0" #12837

Closed
parlay96 opened this issue Jul 3, 2024 · 28 comments

Comments

@parlay96
Copy link

parlay96 commented Jul 3, 2024

Environment

self-hosted (https://develop.sentry.dev/self-hosted/)

Steps to Reproduce

1: Firstly, the register method on the server was not executed at all,
image
2: The Sentry platform also did not collect any errors regarding the server side
image
3:Only client errors are effective for the client
image

Expected Result

How to solve it?

Actual Result

1: Firstly, the register method on the server was not executed at all,
image
2: The Sentry platform also did not collect any errors regarding the server side
image
3:Only client errors are effective for the client
image

Product Area

Unknown

Link

No response

DSN

No response

Version

"@sentry/nextjs": "8.13.0"

@getsantry
Copy link

getsantry bot commented Jul 3, 2024

Assigning to @getsentry/support for routing ⏲️

@InterstellarStella InterstellarStella transferred this issue from getsentry/sentry Jul 4, 2024
@aldy505
Copy link

aldy505 commented Jul 4, 2024

Can you confirm that this is only happening with Nextjs and this is not happening on any other language/platforms?

@parlay96
Copy link
Author

parlay96 commented Jul 5, 2024

@aldy505 I'm certainly not sure, but there's this situation next,However, what I have learned is that the next version on my end is 12.xx, which is a version issue

@aldy505
Copy link

aldy505 commented Jul 9, 2024

I don't think this has anything to do with self-hosted. Since Sentry should receive all the data, I guess this is much likely a problem on the SDK itself.

@hubertdeng123 @azaslavsky can we transfer this to sentry-javascript?

@hubertdeng123 hubertdeng123 transferred this issue from getsentry/self-hosted Jul 9, 2024
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jul 9, 2024
@chargome
Copy link
Member

Hi @parlay96, as discussed in #12746, Next.js v12 is not supported by "@sentry/nextjs": "8.13.0". Can you confirm that you have downgraded your SDK to v7?

@parlay96
Copy link
Author

@chargome Haha, I didn't downgrade,But I know the problem now, it was caused by next 12.xx

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jul 10, 2024
@parlay96
Copy link
Author

parlay96 commented Jul 10, 2024

@chargome This is a repetitive question I asked before, and I know how to solve it , Thank you;We are about to upgrade to 14.xx

@chargome
Copy link
Member

Good to hear you were able to resolve it! Upgrading to Next.js v14 is definitely a good idea to ensure ongoing compatibility with Sentry's latest features. Closing this, feel free to ping me if you need more help.

@parlay96
Copy link
Author

你好@parlay96,如#12746中所述,Next.js v12 不受支持"@sentry/nextjs": "8.13.0"。您能确认已将 SDK 降级到 v7 吗?

Hi @parlay96, as discussed in #12746, Next.js v12 is not supported by "@sentry/nextjs": "8.13.0". Can you confirm that you have downgraded your SDK to v7?

Hi, I've downgraded to version 7.18, why do I need a second parameter for this?

Image

@parlay96
Copy link
Author

@chargome
why do I need a second parameter for this?
Image

@parlay96
Copy link
Author

@chargome

Image

When I use withSentryGetServerSideProps, it seems to have become obsolete

Image

@chargome
Copy link
Member

Hi @parlay96, not sure if I get your question. withSentryGetServerSideProps has been deprecated in favour of wrapGetServerSidePropsWithSentry.

@parlay96
Copy link
Author

@chargome I know, but I would like to know why the second parameter of 'wrappGeserverSidePropsWithSentry' is?

@parlay96
Copy link
Author

Image
The document tells me that there is no second parameter

Image

@parlay96
Copy link
Author

@chargome I am very grateful to you. Every time I come to see you for help, thank you

@chargome
Copy link
Member

In the screenshot you posted you can see it: @param parameterizedRoute The page's parameterized route

@parlay96
Copy link
Author

@

In the screenshot you posted you can see it: @param parameterizedRoute The page's parameterized route

Why wasn't the document example written? I am a mandatory item, what is its purpose

@parlay96
Copy link
Author

@chargome Thank you, I'm going to follow you now

@chargome
Copy link
Member

@parlay96 you're right it should be part of the docs. So you want to pass the the route that will be parameterised there, e.g. /someroute -> it will be used for naming the transaction in Sentry.

@parlay96
Copy link
Author

@parlay96 you're right it should be part of the docs. So you want to pass the the route that will be parameterised there, e.g. /someroute -> it will be used for naming the transaction in Sentry.

Thank you

@parlay96
Copy link
Author

@chargome

Image

next 12.x sentry7.1.. wrapGetServerSidePropsWithSentry It seems invalid, no errors have been collected,

Image

@parlay96
Copy link
Author

parlay96 commented Aug 13, 2024

@chargome How do I check this question? Do I still need to raise issues for NextJS?

@chargome
Copy link
Member

@parlay96 in your code you are catching the error, hence no error is being captured by sentry. You can call Sentry.captureException in your catch block and the error will be sent.

@parlay96
Copy link
Author

parlay96 commented Aug 13, 2024

@chargome I know it is possible to report captureException proactively and it can be implemented. Then why do I need to use 'wrapGetServerSidePropsWithSentry'? Wasn't 'wrapGetServerSidePropsWithSentry' just helping me automatically collect errors

@parlay96
Copy link
Author

Image

Is there a problem with my understanding? hahaha

@chargome
Copy link
Member

@parlay96 the SDK will report unhandled exceptions. If you want to send specific errors then use Sentry.captureException.

@parlay96
Copy link
Author

parlay96 commented Aug 13, 2024

@chargome

Image

Thank you, I think I know how to use Sentry now

@parlay96
Copy link
Author

@chargome ha ha ha , Thank you very much for solving my problem. You are my idol

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

No branches or pull requests

3 participants