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

Emoji literals cause Next.js v14 HMR to crash when Sentry v8 server-side instrumentation is running #15101

Closed
3 tasks done
staticshock opened this issue Jan 21, 2025 · 3 comments
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK

Comments

@staticshock
Copy link
Contributor

staticshock commented Jan 21, 2025

I know that this appears to be Next.js-side error, but it baffles me that it did not happen until I updated Sentry to v8, even though I was previously using OTel w/Next.js. I don't have the setup to troubleshoot it deeply enough to file an appropriate Next.js issue. Sentry's OTel instrumentation is implicated here somehow, but I can't tell how.

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

8.50

Framework Version

Next v14.2.23

Link to Sentry event

No response

Reproduction Example/SDK Setup

Clone this sample repo and follow instructions in the README: https://github.com/staticshock/repros/tree/nextjs-14-sentry-8-15101

Otherwise, follow the longer instructions below.

Steps to Reproduce

  1. Create a repo with Next.js 14 + Sentry v8 (or clone the sample repo I shared above)
  2. Set up server-side Sentry tracking using instrumentation.ts (already done in the sample repo)
  3. Add 'use client' to app/page.tsx
  4. Run pnpm install && pnpm dev --turbo
  5. Open app in browser (https://localhost:3000/)
  6. Add an emoji character to the react component in app/page.tsx
  7. Watch in disbelief as the app crashes and burns.

Expected Result

HMR does not break.

Actual Result

HMR breaks and stays broken until the dev server is killed and restarted.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 21, 2025
@github-actions github-actions bot added the Package: nestjs Issues related to the Sentry Nestjs SDK label Jan 21, 2025
@staticshock
Copy link
Contributor Author

This issue relates to nextjs, not nestjs. I made a typo originally, and sadly I can't correct the wrong issue label.

@andreiborza andreiborza added Package: nextjs Issues related to the Sentry Nextjs SDK and removed Package: nestjs Issues related to the Sentry Nestjs SDK labels Jan 21, 2025
@andreiborza
Copy link
Member

Hey @staticshock, thanks for filing this.

We don't officially support Trubopack yet, you can follow the status by subscribing to #8105.

I couldn't really find the underlying cause from a quick look. The moment the next config is wrapped with withSentryConfig it starts occurring.

I recommend switching to non Turbopack builds and dev mode.

@staticshock staticshock changed the title Emoji literals cause Next.js HMR to crash when Sentry v8 server-side instrumentation is running Emoji literals cause Next.js v14 HMR to crash when Sentry v8 server-side instrumentation is running Jan 21, 2025
@staticshock
Copy link
Contributor Author

Can be fixed by turning off turbopack or upgrading to Next v15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK
Projects
Archived in project
Development

No branches or pull requests

2 participants