Skip to content

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

@staticshock

Description

@staticshock

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPackage: nextjsIssues related to the Sentry Nextjs SDK

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions