From 8f2ef92f510a154d150717222f106bf3b925dd46 Mon Sep 17 00:00:00 2001 From: Onur Temizkan Date: Fri, 7 Mar 2025 14:15:11 +0000 Subject: [PATCH] fix(remix): Move `instrumentBuild` inside `fetch` callback. --- .../javascript/guides/remix/frameworks/hydrogen.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/platforms/javascript/guides/remix/frameworks/hydrogen.mdx b/docs/platforms/javascript/guides/remix/frameworks/hydrogen.mdx index c989adafdf007c..fb792ffc3453ff 100644 --- a/docs/platforms/javascript/guides/remix/frameworks/hydrogen.mdx +++ b/docs/platforms/javascript/guides/remix/frameworks/hydrogen.mdx @@ -49,10 +49,6 @@ import { instrumentBuild } from "@sentry/remix/cloudflare"; // Virtual entry point for the app import * as remixBuild from 'virtual:remix/server-build'; -// Instrument your server build with Sentry -// and use the instrumented build inside the fetch handler -const instrumentedBuild = instrumentBuild(remixBuild) - /** * Export a fetch handler in module format. */ @@ -73,6 +69,10 @@ export default { context: executionContext, }, async () => { + // Instrument your server build with Sentry + // and use the instrumented build inside the fetch handler + const instrumentedBuild = instrumentBuild(remixBuild) + // request handling logic } );