From 0296dfde20f800478f03439087a5292a1c6a43a9 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Mon, 7 Apr 2025 13:19:50 +0200 Subject: [PATCH 1/3] Update cloudflare config snippets to use jsonc --- .../guides/cloudflare/features/d1.mdx | 2 +- .../guides/cloudflare/frameworks/astro.mdx | 15 ++++++++-- .../guides/cloudflare/frameworks/remix.mdx | 13 +++++++-- .../cloudflare/frameworks/sveltekit.mdx | 13 +++++++-- .../javascript/guides/cloudflare/index.mdx | 27 +++++++++--------- .../javascript/guides/hono/index.mdx | 28 ++++++++++--------- .../primer/javascript.cloudflare.mdx | 12 +++++++- 7 files changed, 75 insertions(+), 35 deletions(-) diff --git a/docs/platforms/javascript/guides/cloudflare/features/d1.mdx b/docs/platforms/javascript/guides/cloudflare/features/d1.mdx index c389cb7ca2311..f9fa8b301ea63 100644 --- a/docs/platforms/javascript/guides/cloudflare/features/d1.mdx +++ b/docs/platforms/javascript/guides/cloudflare/features/d1.mdx @@ -9,7 +9,7 @@ Cloudflare's serverless SQL database with Sentry. ```javascript import * as Sentry from "@sentry/cloudflare"; -// env.DB is the D1 DB binding configured in your `wrangler.toml` +// env.DB is the D1 DB binding configured in your `wrangler.jsonc`/`wrangler.toml` config const db = Sentry.instrumentD1WithSentry(env.DB); // Now you can use the database as usual await db.prepare("SELECT * FROM table WHERE id = ?").bind(1).run(); diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx index 9d225208f0cb1..8343fc0896124 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx @@ -11,10 +11,19 @@ After installing the Sentry Astro SDK, you can now install the Sentry Cloudflare -To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.toml`. This is because the SDK +To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. -```toml {filename:wrangler.toml} +```json {tabTitle:JSON} {filename:wrangler.jsonc} +{ + "compatibility_flags": [ + "nodejs_compat" + // "nodejs_als" + ] +} +``` + +```toml {tabTitle:Toml} {filename:wrangler.toml} compatibility_flags = ["nodejs_compat"] # compatibility_flags = ["nodejs_als"] ``` @@ -30,7 +39,7 @@ export const onRequest = [ dsn: "___PUBLIC_DSN___", // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. // Learn more at - // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, })), // Add more middlewares here diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx index c3e736869808f..ea95d1170cec0 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx @@ -23,10 +23,19 @@ Now you can install the Sentry Cloudflare SDK. First, install the SDK with your -To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.toml`. This is because the SDK +To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. -```toml {filename:wrangler.toml} +```json {tabTitle:JSON} {filename:wrangler.jsonc} +{ + "compatibility_flags": [ + "nodejs_compat" + // "nodejs_als" + ] +} +``` + +```toml {tabTitle:Toml} {filename:wrangler.toml} compatibility_flags = ["nodejs_compat"] # compatibility_flags = ["nodejs_als"] ``` diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/sveltekit.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/sveltekit.mdx index 889f6b88c819e..c1976aebce065 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/sveltekit.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/sveltekit.mdx @@ -23,10 +23,19 @@ If you installed the SDK before, make sure that `@sentry/sveltekit` version `9.2 ## 2. Cloudflare configuration -To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.toml`. This is because the SDK +To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. -```toml {filename:wrangler.toml} +```json {tabTitle:JSON} {filename:wrangler.jsonc} +{ + "compatibility_flags": [ + "nodejs_compat" + // "nodejs_als" + ] +} +``` + +```toml {tabTitle:Toml} {filename:wrangler.toml} compatibility_flags = ["nodejs_compat"] # compatibility_flags = ["nodejs_als"] ``` diff --git a/docs/platforms/javascript/guides/cloudflare/index.mdx b/docs/platforms/javascript/guides/cloudflare/index.mdx index 82dc16f61d376..f6994483bf582 100644 --- a/docs/platforms/javascript/guides/cloudflare/index.mdx +++ b/docs/platforms/javascript/guides/cloudflare/index.mdx @@ -1,6 +1,6 @@ --- title: Cloudflare -description: 'Official Sentry SDK for Cloudflare Workers and Cloudflare Pages.' +description: "Official Sentry SDK for Cloudflare Workers and Cloudflare Pages." sdk: sentry.javascript.cloudflare categories: - javascript @@ -11,7 +11,9 @@ categories: ## Install - + In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](/concepts/key-terms/tracing/). @@ -35,24 +37,23 @@ pnpm add @sentry/cloudflare Configuration should happen as early as possible in your application's lifecycle. -To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.toml`/`wrangler.json`. This is because the SDK +To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. - -```toml {tabTitle:Toml} {filename:wrangler.toml} -compatibility_flags = ["nodejs_compat"] -# compatibility_flags = ["nodejs_als"] -``` - -```json {tabTitle:JSON} {filename:wrangler.json} +```json {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ - "nodejs_compat", + "nodejs_compat" // "nodejs_als" ] } ``` +```toml {tabTitle:Toml} {filename:wrangler.toml} +compatibility_flags = ["nodejs_compat"] +# compatibility_flags = ["nodejs_als"] +``` + Then you can install the SDK and add it to your project: You can either setup up the SDK for [Cloudflare Pages](#setup-cloudflare-pages) or [Cloudflare Workers](#setup-cloudflare-workers). @@ -89,7 +90,7 @@ environment. Note that you can turn off almost all side effects using the respec import * as Sentry from "@sentry/cloudflare"; export default Sentry.withSentry( - env => ({ + (env) => ({ dsn: "___PUBLIC_DSN___", // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. // Learn more at @@ -100,7 +101,7 @@ export default Sentry.withSentry( async fetch(request, env, ctx) { return new Response("Hello World!"); }, - } satisfies ExportedHandler, + } satisfies ExportedHandler ); ``` diff --git a/docs/platforms/javascript/guides/hono/index.mdx b/docs/platforms/javascript/guides/hono/index.mdx index d0b81b4b26405..3673f8e2526d4 100644 --- a/docs/platforms/javascript/guides/hono/index.mdx +++ b/docs/platforms/javascript/guides/hono/index.mdx @@ -20,7 +20,9 @@ In addition to capturing errors, you can monitor interactions between multiple s Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below. - + ## Setup @@ -43,12 +45,7 @@ pnpm add @sentry/cloudflare To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.toml`/`wrangler.json`. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. -```toml {tabTitle:Toml} {filename:wrangler.toml} -compatibility_flags = ["nodejs_compat"] -# compatibility_flags = ["nodejs_als"] -``` - -```json {tabTitle:JSON} {filename:wrangler.json} +```json {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ "nodejs_compat" @@ -57,6 +54,11 @@ compatibility_flags = ["nodejs_compat"] } ``` +```toml {tabTitle:Toml} {filename:wrangler.toml} +compatibility_flags = ["nodejs_compat"] +# compatibility_flags = ["nodejs_als"] +``` + Next, wrap your handler with the `withSentry` function. This will initialize the SDK and hook into the environment. Note that you can turn off almost all side effects using the respective options. @@ -101,12 +103,7 @@ pnpm add @sentry/cloudflare To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.toml`/`wrangler.json`. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. -```toml {tabTitle:Toml} {filename:wrangler.toml} -compatibility_flags = ["nodejs_compat"] -# compatibility_flags = ["nodejs_als"] -``` - -```json {tabTitle:JSON} {filename:wrangler.json} +```json {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ "nodejs_compat" @@ -115,6 +112,11 @@ compatibility_flags = ["nodejs_compat"] } ``` +```toml {tabTitle:Toml} {filename:wrangler.toml} +compatibility_flags = ["nodejs_compat"] +# compatibility_flags = ["nodejs_als"] +``` + Next, add the `sentryPagesPlugin` as [middleware to your Cloudflare Pages application](https://developers.cloudflare.com/pages/functions/middleware/). diff --git a/platform-includes/sourcemaps/primer/javascript.cloudflare.mdx b/platform-includes/sourcemaps/primer/javascript.cloudflare.mdx index 8e88ddf417303..6d49a3098a34f 100644 --- a/platform-includes/sourcemaps/primer/javascript.cloudflare.mdx +++ b/platform-includes/sourcemaps/primer/javascript.cloudflare.mdx @@ -3,4 +3,14 @@ Learn how to unminify your JavaScript code by watching this video or reading the -If you are using plain Cloudflare Workers, set `upload_source_maps = true` to your `wrangler.toml` file to enable source map generation. +If you are using plain Cloudflare Workers, set `upload_source_maps = true` in your `wrangler.jsonc`/`wrangler.toml` config file to enable source map generation. + +```json {tabTitle:JSON} {filename:wrangler.jsonc} +{ + "upload_source_maps": true +} +``` + +```toml {tabTitle:Toml} {filename:wrangler.toml} +upload_source_maps = true +``` From 8e5ad3040e3b01241c1cf31944637bcc57be3b6c Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Mon, 7 Apr 2025 13:23:38 +0200 Subject: [PATCH 2/3] use jsonc everywhere --- .../guides/cloudflare/frameworks/astro.mdx | 6 +++--- .../guides/cloudflare/frameworks/remix.mdx | 6 +++--- .../guides/cloudflare/frameworks/sveltekit.mdx | 6 +++--- .../platforms/javascript/guides/cloudflare/index.mdx | 6 +++--- docs/platforms/javascript/guides/hono/index.mdx | 12 ++++++------ .../sourcemaps/primer/javascript.cloudflare.mdx | 4 ++-- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx index 8343fc0896124..249f2cd5fcab1 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx @@ -14,12 +14,12 @@ After installing the Sentry Astro SDK, you can now install the Sentry Cloudflare To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. -```json {tabTitle:JSON} {filename:wrangler.jsonc} +```jsonc {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ - "nodejs_compat" + "nodejs_compat", // "nodejs_als" - ] + ], } ``` diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx index ea95d1170cec0..451576cd5da4f 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx @@ -26,12 +26,12 @@ Now you can install the Sentry Cloudflare SDK. First, install the SDK with your To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. -```json {tabTitle:JSON} {filename:wrangler.jsonc} +```jsonc {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ - "nodejs_compat" + "nodejs_compat", // "nodejs_als" - ] + ], } ``` diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/sveltekit.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/sveltekit.mdx index c1976aebce065..b748608132ce2 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/sveltekit.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/sveltekit.mdx @@ -26,12 +26,12 @@ If you installed the SDK before, make sure that `@sentry/sveltekit` version `9.2 To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. -```json {tabTitle:JSON} {filename:wrangler.jsonc} +```jsonc {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ - "nodejs_compat" + "nodejs_compat", // "nodejs_als" - ] + ], } ``` diff --git a/docs/platforms/javascript/guides/cloudflare/index.mdx b/docs/platforms/javascript/guides/cloudflare/index.mdx index f6994483bf582..12ab3f4b39d24 100644 --- a/docs/platforms/javascript/guides/cloudflare/index.mdx +++ b/docs/platforms/javascript/guides/cloudflare/index.mdx @@ -40,12 +40,12 @@ Configuration should happen as early as possible in your application's lifecycle To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. -```json {tabTitle:JSON} {filename:wrangler.jsonc} +```jsonc {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ - "nodejs_compat" + "nodejs_compat", // "nodejs_als" - ] + ], } ``` diff --git a/docs/platforms/javascript/guides/hono/index.mdx b/docs/platforms/javascript/guides/hono/index.mdx index 3673f8e2526d4..8deeacbd4c235 100644 --- a/docs/platforms/javascript/guides/hono/index.mdx +++ b/docs/platforms/javascript/guides/hono/index.mdx @@ -45,12 +45,12 @@ pnpm add @sentry/cloudflare To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.toml`/`wrangler.json`. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. -```json {tabTitle:JSON} {filename:wrangler.jsonc} +```jsonc {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ - "nodejs_compat" + "nodejs_compat", // "nodejs_als" - ] + ], } ``` @@ -103,12 +103,12 @@ pnpm add @sentry/cloudflare To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.toml`/`wrangler.json`. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. -```json {tabTitle:JSON} {filename:wrangler.jsonc} +```jsonc {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ - "nodejs_compat" + "nodejs_compat", // "nodejs_als" - ] + ], } ``` diff --git a/platform-includes/sourcemaps/primer/javascript.cloudflare.mdx b/platform-includes/sourcemaps/primer/javascript.cloudflare.mdx index 6d49a3098a34f..e3e8e1206ad8d 100644 --- a/platform-includes/sourcemaps/primer/javascript.cloudflare.mdx +++ b/platform-includes/sourcemaps/primer/javascript.cloudflare.mdx @@ -5,9 +5,9 @@ Learn how to unminify your JavaScript code by watching this video or reading the If you are using plain Cloudflare Workers, set `upload_source_maps = true` in your `wrangler.jsonc`/`wrangler.toml` config file to enable source map generation. -```json {tabTitle:JSON} {filename:wrangler.jsonc} +```jsonc {tabTitle:JSON} {filename:wrangler.jsonc} { - "upload_source_maps": true + "upload_source_maps": true, } ``` From 8e0a4b8b1533152638a59b5d4d3b78ec4b0d98a2 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Mon, 7 Apr 2025 13:35:36 +0200 Subject: [PATCH 3/3] more re-ordering --- .../guides/cloudflare/frameworks/astro.mdx | 11 ++++++++--- .../guides/cloudflare/frameworks/remix.mdx | 10 +++++----- .../guides/cloudflare/frameworks/sveltekit.mdx | 10 +++++----- .../platforms/javascript/guides/cloudflare/index.mdx | 8 ++++---- docs/platforms/javascript/guides/hono/index.mdx | 12 ++++++------ 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx index 249f2cd5fcab1..1d61fb0ff6f46 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx @@ -11,18 +11,23 @@ After installing the Sentry Astro SDK, you can now install the Sentry Cloudflare -To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK +To use the SDK, you'll need to set either the `nodejs_als` or `nodejs_compat` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. ```jsonc {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ - "nodejs_compat", - // "nodejs_als" + "nodejs_als", + // "nodejs_compat" ], } ``` +```toml {tabTitle:Toml} {filename:wrangler.toml} +compatibility_flags = ["nodejs_als"] +# compatibility_flags = ["nodejs_compat"] +``` + ```toml {tabTitle:Toml} {filename:wrangler.toml} compatibility_flags = ["nodejs_compat"] # compatibility_flags = ["nodejs_als"] diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx index 451576cd5da4f..271c9281f4519 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx @@ -23,21 +23,21 @@ Now you can install the Sentry Cloudflare SDK. First, install the SDK with your -To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK +To use the SDK, you'll need to set either the `nodejs_als` or `nodejs_compat` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. ```jsonc {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ - "nodejs_compat", - // "nodejs_als" + "nodejs_als", + // "nodejs_compat" ], } ``` ```toml {tabTitle:Toml} {filename:wrangler.toml} -compatibility_flags = ["nodejs_compat"] -# compatibility_flags = ["nodejs_als"] +compatibility_flags = ["nodejs_als"] +# compatibility_flags = ["nodejs_compat"] ``` Then create a `_middleware.js` file in your `functions` directory and add the following code: diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/sveltekit.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/sveltekit.mdx index b748608132ce2..3a3823df566d0 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/sveltekit.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/sveltekit.mdx @@ -23,21 +23,21 @@ If you installed the SDK before, make sure that `@sentry/sveltekit` version `9.2 ## 2. Cloudflare configuration -To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK +To use the SDK, you'll need to set either the `nodejs_als` or `nodejs_compat` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. ```jsonc {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ - "nodejs_compat", - // "nodejs_als" + "nodejs_als", + // "nodejs_compat" ], } ``` ```toml {tabTitle:Toml} {filename:wrangler.toml} -compatibility_flags = ["nodejs_compat"] -# compatibility_flags = ["nodejs_als"] +compatibility_flags = ["nodejs_als"] +# compatibility_flags = ["nodejs_compat"] ``` ## 3. Update Your Server Hooks File diff --git a/docs/platforms/javascript/guides/cloudflare/index.mdx b/docs/platforms/javascript/guides/cloudflare/index.mdx index 12ab3f4b39d24..4b8ca3eed5987 100644 --- a/docs/platforms/javascript/guides/cloudflare/index.mdx +++ b/docs/platforms/javascript/guides/cloudflare/index.mdx @@ -43,15 +43,15 @@ needs access to the `AsyncLocalStorage` API to work correctly. ```jsonc {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ - "nodejs_compat", - // "nodejs_als" + "nodejs_als", + // "nodejs_compat" ], } ``` ```toml {tabTitle:Toml} {filename:wrangler.toml} -compatibility_flags = ["nodejs_compat"] -# compatibility_flags = ["nodejs_als"] +compatibility_flags = ["nodejs_als"] +# compatibility_flags = ["nodejs_compat"] ``` Then you can install the SDK and add it to your project: diff --git a/docs/platforms/javascript/guides/hono/index.mdx b/docs/platforms/javascript/guides/hono/index.mdx index 8deeacbd4c235..245989351aee8 100644 --- a/docs/platforms/javascript/guides/hono/index.mdx +++ b/docs/platforms/javascript/guides/hono/index.mdx @@ -42,21 +42,21 @@ yarn add @sentry/cloudflare pnpm add @sentry/cloudflare ``` -To use the SDK, you'll need to set either the `nodejs_compat` or `nodejs_als` compatibility flags in your `wrangler.toml`/`wrangler.json`. -This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly. +To use the SDK, you'll need to set either the `nodejs_als` or `nodejs_compat` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK +needs access to the `AsyncLocalStorage` API to work correctly. ```jsonc {tabTitle:JSON} {filename:wrangler.jsonc} { "compatibility_flags": [ - "nodejs_compat", - // "nodejs_als" + "nodejs_als", + // "nodejs_compat" ], } ``` ```toml {tabTitle:Toml} {filename:wrangler.toml} -compatibility_flags = ["nodejs_compat"] -# compatibility_flags = ["nodejs_als"] +compatibility_flags = ["nodejs_als"] +# compatibility_flags = ["nodejs_compat"] ``` Next, wrap your handler with the `withSentry` function. This will initialize the SDK and hook into the