-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Auto-wrapping not working for Next.js Dynamic Routes #8442
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
Comments
Hey, thanks for writing in! I sadly cannot reproduce this. Would you mind sharing a reproduction setup? (git repo we could pull or stackblitz or similar) I have a suspicion that app/checkout/[step]/page.jsx might simply have a syntax error. |
Closing this issue for cleanup. Please re-open if this still applies. Thanks! |
Still happening here. Works in Next.js 13.4.7 and fails when I try to upgrade to Next.js 13.4.9. I don't have an app directory (still using Standard Next.js setup according to the docs, Unfortunately I'm unable to share code as there is an NDA and I can't reproduce it with a minimal example either. |
@mayrsascha Without proper reproduction we unfortunately not help you. I recommend upgrading nextjs to the newest version and opening a new issue if you have more information to share (your setup, full error messages, and so on) |
@lforst I checked again, there is one thing I can share here: Again quickly about my setup:
The error happens on the Here again the content of
And this is the error I'm seeing:
My
My
My
Again: this works with NextJS 13.4.7 for me. When I try to upgrade to NextJS 13.4.9 it fails. Not just for this NextJS page, but for others as well (can't share those unfortunately) |
@mayrsascha Can you please try upgrading to the latest Next.js version? Thanks! Other than that we need full and proper reproduction. In general this error is not dangerous. You application will still work. The error doesn't even mean that Sentry did something wrong. It basically means that the SDK encountered invalid syntax when wepback passed the |
@lforst I Just upgraded to the latest version 13.5.1. Still happening. I ran the Next.js build locally now. The problem is that this error does seem to break the build, so even though my application would work the build can't pass -> No deployment. I think I figured out why the issue is happening now. It seems that the "invalid syntax" is the ES6 optional chaining. For example, in Sentry's auto-generated
While I, unfortunately, can't share the rest of the code, all the other pages that don't build are also failing exactly on lines where optional chaining is used. My local error trace:
|
@mayrsascha Have you been able to resolve this, I am running into a similar issue |
No, I ultimately removed the error page, haven't tried this on the latest Sentry version though. |
interestingly running The error I am getting is:
I think the unexpected token is this line:
|
The SDK doesn't support import assertions yet. Please exclude the file from auto-instrumentation: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#opt-in-to-auto-instrumentation-on-specific-routes @Zarathustra2 would you mind opening a separate issue for this? |
Thanks! Done #11949 |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.57.0
Framework Version
7.57.0
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
app/checkout/[step]/page.jsx
Expected Result
Auto-wrapping to work
Actual Result
The text was updated successfully, but these errors were encountered: