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

feat(nuxt): Add Cloudflare Nitro plugin

Open s1gr1d opened this issue 10 months ago • 1 comments

⚠️ This PR is a work-in-progress and APIs and naming might change

A plugin which initializes Sentry when deployed to Cloudflare.

  1. Remove the previous server config file: sentry.server.config.ts
  2. Add a plugin in server/plugins (e.g. server/plugins/sentry-cloudflare-setup.ts)
  3. Add this code in your plugin file
    // server/plugins/sentry-cloudflare-setup.ts (filename does not matter)
    import { cloudflareNitroPlugin } from '@sentry/nuxt/module/plugins'
    
    export default defineNitroPlugin(cloudflareNitroPlugin({
        dsn: 'https://dsn',
        tracesSampleRate: 1.0,
    }))
    

s1gr1d avatar Mar 05 '25 15:03 s1gr1d

:x: Unsupported file format

Upload processing failed due to unsupported file format. Please review the parser error message:
Error deserializing json

Caused by: expected value at line 1 column 1

For more help, visit our troubleshooting guide.

codecov[bot] avatar Jun 27 '25 08:06 codecov[bot]

Addition to the Cursor comments:

  • Although the type is different (H3Event and CfEventType), both share the same context.cf property.
  • The meta tags are always strings. It's based on the type definition of Nuxt.

s1gr1d avatar Jun 27 '25 13:06 s1gr1d