getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.76k stars 1.52k forks source link

CloudFlare pages with NextJS support (specifically RSCs) #11920

Open steebchen opened 2 months ago

steebchen commented 2 months ago

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

@sentry/nextjs 7.113.0

Framework Version

@sentry/nextjs 7.113.0

Link to Sentry event

https://polar-lights.sentry.io/issues/5299066015/?project=4507178042589184&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=14d&stream_index=0

SDK Setup

import * as Sentry from '@sentry/nextjs'

Sentry.init({
  dsn: 'https://ec343f96933dc8a577ac9237c6907690@o1013545.ingest.us.sentry.io/4507178042589184',

  // Adjust this value in production, or use tracesSampler for greater control
  tracesSampleRate: 1,

  // Setting this option to true will print useful information to the console while you're setting up Sentry.
  debug: false,
})

Steps to Reproduce

I'm not really sure if it's related to CloudFlare pages, but it's where I can reproduce not being able to see any errors produced by RSCs. Anyway, I just have this simply test route in app/sentry-example-page/page.tsx:

export const runtime = 'edge'   

export default async function Page() {
  throw new Error('Sentry Example API Route Error')
}

Expected Result

An error being reported in sentry.

Actual Result

No error is being reported in Sentry (except for a frontend error due to the error component being rendered, but the error info is missing here which is expected (see #9474)).

Interestingly, app router API routes are reported correctly, but RSC errors are not.

lforst commented 2 months ago

Hi, cloudflare pages are not supported by our official SDKs yet. You may want to look into https://github.com/robertcepa/toucan-js

steebchen commented 2 months ago

Oh I see. Since it's "just" NextJS I figured it just works. Actually the frontend and the app dir API routes already work perfectly fine, just RSCs don't it seems (and I haven't tested if server actions work). Anyway this issue might then be considered official CloudFlare Pages with NextJS request. 😅 And thanks for the pointer to toucan-js!

getsantry[bot] commented 3 weeks ago

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 remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

steebchen commented 3 weeks ago

Can we mark this as not stale please? (thanks @getsantry I guess)

Lms24 commented 3 weeks ago

The issue won't close but unfortunately, there' no update for CloudFlare support from our end at the moment.

vladinator1000 commented 2 weeks ago

Hey folks, I'll upgrade to the team plan if you add Cloudflare Pages support. Toucan source maps don't work for me https://github.com/robertcepa/toucan-js/issues/236

steebchen commented 4 hours ago

related: #12620

It would be great if someone from CloudFlare could link to this issue from #12620 for tracking

lforst commented 3 hours ago

@steebchen 🫡