sentry-javascript
sentry-javascript copied to clipboard
feat(nuxt): Add Cloudflare Nitro plugin
⚠️ This PR is a work-in-progress and APIs and naming might change
A plugin which initializes Sentry when deployed to Cloudflare.
- Remove the previous server config file:
sentry.server.config.ts - Add a plugin in
server/plugins(e.g.server/plugins/sentry-cloudflare-setup.ts) - 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, }))
: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.
Addition to the Cursor comments:
- Although the type is different (
H3EventandCfEventType), both share the samecontext.cfproperty. - The meta tags are always strings. It's based on the type definition of Nuxt.