sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

CloudFlare pages with NextJS support (specifically RSCs)

Open steebchen opened this issue 1 year ago • 6 comments

Is there an existing issue for this?

  • [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [X] I have reviewed the documentation https://docs.sentry.io/
  • [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

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://[email protected]/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.

steebchen avatar May 06 '24 16:05 steebchen

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

lforst avatar May 06 '24 17:05 lforst

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!

steebchen avatar May 06 '24 17:05 steebchen

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 🥀

getsantry[bot] avatar Jun 12 '24 07:06 getsantry[bot]

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

steebchen avatar Jun 12 '24 15:06 steebchen

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

Lms24 avatar Jun 13 '24 07:06 Lms24

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

vladinator1000 avatar Jun 24 '24 19:06 vladinator1000

related: #12620

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

steebchen avatar Jul 09 '24 11:07 steebchen

@steebchen 🫡

lforst avatar Jul 09 '24 13:07 lforst