From 6519f707fb4ff6ac682c2c7527ba19f10f17a98d Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Tue, 27 Oct 2026 13:45:32 +0100 Subject: [PATCH 001/143] docs(react-native): Add Jest "Unexpected token 'export'" troubleshooting (#20251) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## DESCRIBE YOUR PR Adds a React Native troubleshooting entry for Jest failing with `SyntaxError: Unexpected token 'export'` when a test imports `@sentry/react-native` without mocking it. Since `@sentry/react-native` 8.15.0 (JavaScript SDK 10.58.0), the `@sentry/*` packages expose a `react-native` export condition that resolves to their ES module build. The React Native Jest environment enables that condition, but `jest-expo` only transforms `@sentry/react-native` and `@react-native/jest-preset` transforms no `@sentry/*` packages, so Jest loads untransformed ESM from `@sentry/core` and the other `@sentry/*` packages. The new section documents how to extend `transformIgnorePatterns` to cover `@sentry/.*`, both by reusing the `jest-expo` preset's patterns and for custom configs based on `@react-native/jest-preset`. Fixes getsentry/sentry-react-native#6953 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the due date. You can update this information later by editing the PR description. - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [ ] Other deadline: YYYY-MM-DD - [x] No deadline: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've supplied a deadline. Thanks in advance for your help! ## PRE-MERGE CHECKLIST _Make sure you've checked the following before merging your changes:_ - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) πŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 --- .../common/troubleshooting/index.mdx | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/platforms/react-native/common/troubleshooting/index.mdx b/docs/platforms/react-native/common/troubleshooting/index.mdx index 9c383088e35b6..9bf9df3d5c90a 100644 --- a/docs/platforms/react-native/common/troubleshooting/index.mdx +++ b/docs/platforms/react-native/common/troubleshooting/index.mdx @@ -128,6 +128,40 @@ This setting applies to **all** class and function names β€” not just React comp +## Jest Fails With "Unexpected token 'export'" + +Starting with SDK version `8.15.0`, Jest tests that import `@sentry/react-native` without mocking it may fail with: + +``` +SyntaxError: Unexpected token 'export' +``` + +The error points to a file in `@sentry/core` or another `@sentry/*` package. These packages expose a `react-native` export condition that resolves to their ES module build. The React Native Jest environment enables this condition, but Jest presets don't transform these packages by default, so Jest loads their ES modules without transpiling them. + +To fix this, let Babel transform all `@sentry/*` packages. With `jest-expo`, extend the preset's patterns: + +```javascript {filename:jest.config.js} +const preset = require("jest-expo/jest-preset"); + +module.exports = { + preset: "jest-expo", + transformIgnorePatterns: preset.transformIgnorePatterns.map((pattern) => + pattern.replace("@sentry/react-native", "@sentry/.*") + ), +}; +``` + +If you use another preset, or your `jest-expo` version doesn't list `@sentry/react-native` in its `transformIgnorePatterns`, add `@sentry/.*` to your own pattern: + +```javascript {filename:jest.config.js} +module.exports = { + preset: "@react-native/jest-preset", + transformIgnorePatterns: [ + "node_modules/(?!((jest-)?react-native|@react-native(-community)?|@sentry/.*)/)", + ], +}; +``` + ## Missing Context on Android NDK Events If the context - such as breadcrumbs, user, etc. - is missing on Android NDK events, you need to enable the [Scope Synchronization](/platforms/react-native/enriching-events/scopes/#scope-synchronization) feature. From c8f68d1b370a5c8c65dccc8908b7ce89d1abdcf2 Mon Sep 17 00:00:00 2001 From: Sigrid <32902192+s1gr1d@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:48:23 +0100 Subject: [PATCH 002/143] docs(nextjs): Document the tunnel route handler and tunnel credentials (#20075) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## DESCRIBE YOUR PR Documents the tunnel changes in SDK 11.9.0. ⚠️ Merge this PR only after 10.77.1 and 11.9.0 are released. - Next.js `tunnelRoute`: add handler mode (`app/sentry-tunnel/route.ts`). In this mode, a route handler in the app forwards only the request body to Sentry. Rewrite mode now sends with `credentials: "omit"`. Apps behind Vercel Deployment Protection or another login should use handler mode. - Troubleshooting: list what a custom tunnel must do, add `handleTunnelRequest`, and add a new "Credentials on Tunnel Requests" entry. - Short notes in `options.mdx`, the getting-started includes, the Next.js setup pages, and TanStack Start. Related SDK PRs, all going to be released in **11.9.0**: - getsentry/sentry-javascript#25456 - getsentry/sentry-javascript#25515 - getsentry/sentry-javascript#25509 Backport PRs for **10.77.1**: - https://github.com/getsentry/sentry-javascript/pull/25559 - https://github.com/getsentry/sentry-javascript/pull/25560 - https://github.com/getsentry/sentry-javascript/pull/25561 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the due date. You can update this information later by editing the PR description. - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [x] Other deadline: with the 11.9.0 release - [ ] No deadline: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've supplied a deadline. Thanks in advance for your help! ## PRE-MERGE CHECKLIST _Make sure you've checked the following before merging your changes:_ - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --- .../common/configuration/options.mdx | 2 + .../common/troubleshooting/index.mdx | 51 ++++++++++++- .../guides/cordova/configuration/options.mdx | 2 + .../nextjs/configuration/build/index.mdx | 74 +++++++++++++++++-- .../javascript/guides/nextjs/index.mdx | 3 + .../guides/nextjs/manual-setup/index.mdx | 8 ++ .../nextjs/manual-setup/webpack-setup.mdx | 3 + .../features/createSentryTunnelRoute.mdx | 2 +- .../features/sentryTanstackStart.mdx | 2 +- .../getting-started-tunneling/javascript.mdx | 2 +- .../javascript.sveltekit.mdx | 2 +- 11 files changed, 137 insertions(+), 14 deletions(-) diff --git a/docs/platforms/javascript/common/configuration/options.mdx b/docs/platforms/javascript/common/configuration/options.mdx index 37153b6370c62..0953eb5576478 100644 --- a/docs/platforms/javascript/common/configuration/options.mdx +++ b/docs/platforms/javascript/common/configuration/options.mdx @@ -87,6 +87,8 @@ Environments are case-sensitive. The environment name can't contain newlines, sp Sets the URL that will be used to transport captured events. This can be used to work around ad-blockers or to have more granular control over events sent to Sentry. Adding your DSN is still required when using this option so necessary attributes can be set on the generated Sentry data. This option **requires the implementation** of a custom server endpoint. Learn more and find examples in [Dealing with Ad-Blockers](/platforms/javascript/troubleshooting/#dealing-with-ad-blockers). +The endpoint must forward only the request body to Sentry and accept only your own DSNs. Learn more in [Using the `tunnel` Option](/platforms/javascript/troubleshooting/#using-the-tunnel-option). + diff --git a/docs/platforms/javascript/common/troubleshooting/index.mdx b/docs/platforms/javascript/common/troubleshooting/index.mdx index 27a2e12db5ccf..1fb9a9adef7e9 100644 --- a/docs/platforms/javascript/common/troubleshooting/index.mdx +++ b/docs/platforms/javascript/common/troubleshooting/index.mdx @@ -250,7 +250,28 @@ Sentry.init({ }); ``` -Once configured, all events will be sent to the `/tunnel` endpoint. This solution, however, requires an additional configuration on the server, as the events now need to be parsed and redirected to Sentry. Here's an example for your server component: +Once configured, all events will be sent to the `/tunnel` endpoint. This solution, however, requires an additional configuration on the server, as the events now need to be parsed and redirected to Sentry. + +Your tunnel endpoint must: + +- Forward only the request body to Sentry, without the request headers. +- Accept only envelopes whose DSN is on a list of allowed DSNs. Otherwise, anyone can use your endpoint to send requests to other servers. +- Send the envelope only to the host of that DSN. + +On a JavaScript server with Fetch API `Request` and `Response` objects, `handleTunnelRequest` from `@sentry/core` (SDK version `10.40.0` and later) does this for you. Starting with versions `10.77.1` (v10) and `11.9.0` (v11), it also rejects requests larger than 20 MiB. + +```javascript +import { handleTunnelRequest } from "@sentry/core"; + +export async function POST(request) { + return handleTunnelRequest({ + request, + allowedDsns: ["___PUBLIC_DSN___"], + }); +} +``` + +If you implement the endpoint yourself, here's an example for your server component: ```csharp @@ -334,7 +355,7 @@ const SENTRY_PROJECT_IDS = ["123456"]; export const postAction = async ({ request }) => { try { - const envelopeBytes = await req.arrayBuffer(); + const envelopeBytes = await request.arrayBuffer(); const envelope = new TextDecoder().decode(envelopeBytes); const piece = envelope.split("\n")[0]; const header = JSON.parse(piece); @@ -420,6 +441,32 @@ If you would like to copy and paste the snippet directly, here it is minified: + + +The browser SDK doesn't set the [`credentials`](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials) option of `fetch`. With the default value `same-origin`, the browser sends credentials (cookies and HTTP authentication) to a tunnel on the same origin as your app. A tunnel that forwards request headers sends these credentials to Sentry. + + + +The Next.js `tunnelRoute` option handles this for you. See `tunnelRoute`. + + + +Forward only the request body, or tell the browser to send no credentials: + +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tunnel: "/tunnel", + transportOptions: { + fetchOptions: { credentials: "omit" }, + }, +}); +``` + +If a layer in front of your tunnel requires credentials (for example, Vercel Deployment Protection, Cloudflare Access, or HTTP Basic authentication), it rejects requests without credentials. Keep the default in this case, and make sure that your tunnel doesn't forward the request headers. + + + diff --git a/docs/platforms/javascript/guides/cordova/configuration/options.mdx b/docs/platforms/javascript/guides/cordova/configuration/options.mdx index 6955b0c1f4e72..6906a9235b502 100644 --- a/docs/platforms/javascript/guides/cordova/configuration/options.mdx +++ b/docs/platforms/javascript/guides/cordova/configuration/options.mdx @@ -51,6 +51,8 @@ Environments are case-sensitive. The environment name can't contain newlines, sp Sets the URL that will be used to transport captured events. This can be used to work around ad-blockers or to have more granular control over events sent to Sentry. Adding your DSN is still required when using this option so necessary attributes can be set on the generated Sentry data. This option **requires the implementation** of a custom server endpoint. Learn more and find examples in [Dealing with Ad-Blockers](/platforms/javascript/troubleshooting/#dealing-with-ad-blockers). +The endpoint must forward only the request body to Sentry and accept only your own DSNs. Learn more in [Using the `tunnel` Option](/platforms/javascript/troubleshooting/#using-the-tunnel-option). + diff --git a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx index 894b524e379ba..17b8795745151 100644 --- a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx @@ -205,7 +205,7 @@ Note: Enabling this option can lead to longer build times. -This feature requires **Next.js version 11+** and doesn't currently work with self-hosted Sentry instances. +This feature requires **Next.js version 11+**. Rewrite mode doesn't work with self-hosted Sentry instances. Tunnel Sentry requests through this route on your Next.js server to prevent ad-blockers from blocking Sentry events from being sent. @@ -215,15 +215,73 @@ This option can be set to: - `true` for auto-generated routes, which are unpredictable and change with each deployment. - A custom static string path like `/error-monitoring`. + + +Your middleware (`proxy.ts` or `middleware.ts`) also runs for tunnel requests. On v10, the SDK skips your middleware only in rewrite mode with Webpack. Exclude the tunnel route in its `matcher`. This needs a fixed string, because `true` creates a new path for each build: + +```typescript {filename:proxy.ts} +export const config = { + matcher: ["/((?!error-monitoring|_next/static|_next/image|favicon.ico).*)"], +}; +``` + + + Learn more about tunneling in the troubleshooting section. - - If you're using Turbopack, client-side event recording will fail if your - Next.js middleware intercepts the configured tunnel route. To fix this, set - the route to a fixed string (like `/error-monitoring`) and add a negative - matcher like `(?!error-monitoring)` in your middleware to exclude the tunnel - route. If you're not using Turbopack, Sentry will automatically skip the - tunnel route in your middleware. +The tunnel route works in one of two modes: + +- **Rewrite mode** (default): A Next.js rewrite proxies each request to Sentry with all its request headers. Works only with Sentry SaaS DSNs. +- **Handler mode**: A route handler in your app forwards only the request body to Sentry. Works with any DSN. + +Starting with versions `10.77.1` (v10) and `11.9.0` (v11), the browser sends tunnel requests in rewrite mode [with `credentials: "omit"`](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials). +If a layer in front of your app requires credentials (for example, Vercel Deployment Protection or HTTP Basic authentication), it rejects these requests. Use handler mode in this case. +You can also set `credentials: "same-origin"`, but rewrite mode then forwards the credentials to Sentry: + +```javascript {filename:instrumentation-client.ts} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + transportOptions: { + fetchOptions: { credentials: "same-origin" }, + }, +}); +``` + +**Handler mode** + + + +Keep `tunnelRoute` and add this file. If your app uses a `src` directory, add it at `src/app/sentry-tunnel/route.ts`: + +```typescript {filename:app/sentry-tunnel/route.ts} +export { POST } from "@sentry/nextjs/tunnel"; +``` + +This works with any `tunnelRoute` value, including `true`. When the SDK finds the file, the build prints this line: + +```bash +[@sentry/nextjs] The tunnel route sends events through app/sentry-tunnel/route.ts. Only the event payload goes to Sentry. +``` + +If the line is missing, the SDK uses rewrite mode. + +The handler accepts only the DSN of your server-side SDK. It rejects other DSNs with a `403` and requests larger than 20 MiB with a `413`. If your browser SDK uses a different DSN, list the allowed DSNs: + +```typescript {filename:app/sentry-tunnel/route.ts} +import { createSentryTunnelRoute } from "@sentry/nextjs/tunnel"; + +export const { POST } = createSentryTunnelRoute({ + allowedDsns: ["___PUBLIC_DSN___"], +}); +``` + + + +- Handler mode works only with the App Router. +- The SDK doesn't find the file in a route group, such as `app/(group)/sentry-tunnel/`. +- With `"moduleResolution": "node"` in `tsconfig.json`, the type check fails with `Cannot find module '@sentry/nextjs/tunnel'`. Set `moduleResolution` to `bundler`, `node16`, or `nodenext`. +- Each event request runs the route handler. On serverless hosts, this is one function invocation for each request. + diff --git a/docs/platforms/javascript/guides/nextjs/index.mdx b/docs/platforms/javascript/guides/nextjs/index.mdx index d5a6b14c9e06d..71fff4aae652d 100644 --- a/docs/platforms/javascript/guides/nextjs/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/index.mdx @@ -139,6 +139,9 @@ If you use the App Router, the wizard adds Sentry to `app/global-error.tsx` to c The wizard wraps your Next.js configuration with `withSentryConfig`. This instruments your app at build time, uploads source maps, and, if you said yes in the wizard, routes browser requests to Sentry through your server to avoid ad blockers. +To forward only the request body to Sentry, add a tunnel route handler (SDK version `10.77.1` and later on v10, `11.9.0` and later on v11). Use the handler if Vercel Deployment Protection or another login protects your app. +Learn more about the [`tunnelRoute` option](/platforms/javascript/guides/nextjs/configuration/build/#tunnelRoute). + ```typescript {filename:next.config.ts} import type { NextConfig } from "next"; import { withSentryConfig } from "@sentry/nextjs/config"; diff --git a/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx b/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx index f8abeb4a8cb59..ddbc212f18dea 100644 --- a/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx @@ -254,6 +254,9 @@ Prevent ad blockers from blocking Sentry events by routing them through your Nex This increases server load. Consider the trade-off for your application. +To forward only the request body to Sentry, also add `app/sentry-tunnel/route.ts` (SDK version `10.77.1` and later on v10, `11.9.0` and later on v11). +Use this file if Vercel Deployment Protection or another login protects your app. Learn more in `tunnelRoute`. + If you're using Next.js proxy/middleware that intercepts requests, exclude the tunnel route. The file is called `proxy.ts` in Next.js 16+ and `middleware.ts` in Next.js 15: @@ -273,6 +276,11 @@ export default withSentryConfig(nextConfig, { }); ``` +```typescript {filename:app/sentry-tunnel/route.ts} +// Forward only the request body to Sentry +export { POST } from "@sentry/nextjs/tunnel"; +``` + ### Control the Data You Send to Sentry (Optional) diff --git a/docs/platforms/javascript/guides/nextjs/manual-setup/webpack-setup.mdx b/docs/platforms/javascript/guides/nextjs/manual-setup/webpack-setup.mdx index 9b941ed5e3ad2..8e51afc5e733f 100644 --- a/docs/platforms/javascript/guides/nextjs/manual-setup/webpack-setup.mdx +++ b/docs/platforms/javascript/guides/nextjs/manual-setup/webpack-setup.mdx @@ -222,6 +222,9 @@ Tunneling works identically for both Webpack and Turbopack. Sentry automatically Enable tunneling to bypass ad-blockers. Use a fixed route so you can exclude it from middleware if needed. +To forward only the request body to Sentry, add a tunnel route handler (SDK version `10.77.1` and later on v10, `11.9.0` and later on v11). +Use the handler if Vercel Deployment Protection or another login protects your app. Learn more about the [`tunnelRoute` option](/platforms/javascript/guides/nextjs/configuration/build/#tunnelRoute). + You can use `tunnelRoute: true` to auto-generate a random route. However, random routes cannot be excluded from middleware matchers since the route changes on each build. This may cause issues if you have middleware that intercepts all requests. diff --git a/docs/platforms/javascript/guides/tanstackstart-react/features/createSentryTunnelRoute.mdx b/docs/platforms/javascript/guides/tanstackstart-react/features/createSentryTunnelRoute.mdx index 0242e493afbca..d3244d9717c84 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/features/createSentryTunnelRoute.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/features/createSentryTunnelRoute.mdx @@ -13,7 +13,7 @@ description: "Learn how to manually define a Sentry tunnel route in your TanStac the route file, the DSN allowlist, or can't use the Vite plugin. -The `createSentryTunnelRoute` helper returns a TanStack Start server-route configuration with a `POST` handler that forwards Sentry envelopes to Sentry's ingest servers. Use it inside a file route to expose a same-origin tunnel endpoint. +The `createSentryTunnelRoute` helper returns a TanStack Start server-route configuration with a `POST` handler that forwards Sentry envelopes to Sentry's ingest servers. Use it inside a file route to expose a same-origin tunnel endpoint. It forwards only the request body to Sentry. ## Usage diff --git a/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx b/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx index ab4ae0a30a655..202086bd256c2 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx @@ -97,7 +97,7 @@ sentryTanstackStart({ -The `tunnelRoute` option registers a same-origin TanStack Start server route that forwards Sentry envelopes to Sentry's ingest servers. It also automatically sets the client `tunnel` option in `Sentry.init()` so browser events go through that route. This helps avoid ad blockers and corporate firewalls that block requests to `*.sentry.io`. +The `tunnelRoute` option registers a same-origin TanStack Start server route that forwards Sentry envelopes to Sentry's ingest servers. It also automatically sets the client `tunnel` option in `Sentry.init()` so browser events go through that route. This helps avoid ad blockers and corporate firewalls that block requests to `*.sentry.io`. It forwards only the request body to Sentry. `tunnelRoute` accepts three shapes: diff --git a/platform-includes/getting-started-tunneling/javascript.mdx b/platform-includes/getting-started-tunneling/javascript.mdx index 99e9fa6eea924..12c290d10e01f 100644 --- a/platform-includes/getting-started-tunneling/javascript.mdx +++ b/platform-includes/getting-started-tunneling/javascript.mdx @@ -1,6 +1,6 @@ You can prevent ad blockers from blocking Sentry events using tunneling. Use the `tunnel` option in `Sentry.init` to add an API endpoint in your application that forwards Sentry events to Sentry servers. -This will send all events to the `tunnel` endpoint. However, the events need to be parsed and redirected to Sentry, so you'll need to do additional configuration on the server. You can find a detailed explanation on how to do this on our Troubleshooting page. +This will send all events to the `tunnel` endpoint. However, the events need to be parsed and redirected to Sentry, so you'll need to do additional configuration on the server. The endpoint must forward only the request body to Sentry and accept only your own DSN. You can find a detailed explanation on how to do this on our Troubleshooting page. ```javascript {3} Sentry.init({ diff --git a/platform-includes/getting-started-tunneling/javascript.sveltekit.mdx b/platform-includes/getting-started-tunneling/javascript.sveltekit.mdx index 7a1e6d6768bc2..3b1ef2770c630 100644 --- a/platform-includes/getting-started-tunneling/javascript.sveltekit.mdx +++ b/platform-includes/getting-started-tunneling/javascript.sveltekit.mdx @@ -1,6 +1,6 @@ You can prevent ad blockers from blocking Sentry events using tunneling. Use the `tunnel` option inside your `hooks.client.(js|ts)` file's `Sentry.init` to add an API endpoint in your application that forwards Sentry events to Sentry servers. -This will send all events to the `tunnel` endpoint. However, the events need to be parsed and redirected to Sentry, so you'll need to do additional configuration on the server. You can find a detailed explanation on how to do this on our [Troubleshooting page](/platforms/javascript/guides/sveltekit/troubleshooting/#using-the-tunnel-option). +This will send all events to the `tunnel` endpoint. However, the events need to be parsed and redirected to Sentry, so you'll need to do additional configuration on the server. The endpoint must forward only the request body to Sentry and accept only your own DSN. You can find a detailed explanation on how to do this on our [Troubleshooting page](/platforms/javascript/guides/sveltekit/troubleshooting/#using-the-tunnel-option). ```javascript {filename:hooks.client.(js|ts)} {3} Sentry.init({ From 6cfc86f37153fae0635b381909f9ebc5c9ba2c53 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Tue, 27 Oct 2026 15:26:16 +0100 Subject: [PATCH 003/143] docs(react-native): Document opening the feedback form over a presented sheet on iOS (#20255) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## DESCRIBE YOUR PR Adds a troubleshooting subsection to the React Native **User Feedback** page covering a platform limitation on iOS: because UIKit allows only one presentation per view controller, the default `Modal`-based Feedback Form (`showFeedbackForm()`, shake-to-report, the auto-injected button) can't open while a native-stack screen is presented as a sheet (`presentation: "formSheet" | "modal"`). The form silently doesn't appear. Android is unaffected. The new section documents the supported workaround: render the `FeedbackForm` component yourself and, on iOS, wrap it in react-native-screens' `FullWindowOverlay` so it draws above the presented sheet (with a `Modal` fallback on Android). Context: getsentry/sentry-react-native#6875. A proper default-on fix (native own-window presentation) is tracked there as an enhancement; this documents the supported path in the meantime. ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [ ] Other deadline: YYYY-MM-DD - [x] No deadline: Not urgent, can wait up to 1 week+ ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) πŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 --- .../common/user-feedback/index.mdx | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/docs/platforms/react-native/common/user-feedback/index.mdx b/docs/platforms/react-native/common/user-feedback/index.mdx index a7ccd6c7cbf4f..ff6fe7c7d6eae 100644 --- a/docs/platforms/react-native/common/user-feedback/index.mdx +++ b/docs/platforms/react-native/common/user-feedback/index.mdx @@ -93,6 +93,52 @@ Note that when the device is offline, the feedback will be stored locally and se +### Opening the Feedback Form Over a Presented Sheet on iOS + +On iOS, `Sentry.showFeedbackForm()`, shake-to-report, and the auto-injected feedback button present the Feedback Form inside a React Native `Modal`. UIKit only allows one presentation per view controller, so when a native-stack screen is already presented as a sheet (`presentation: "formSheet"` or `"modal"` with `@react-navigation/native-stack`), UIKit refuses the second presentation and the form doesn't appear. Android is unaffected. + +To collect feedback while such a sheet is open, render the [`FeedbackForm`](#feedback-form-component) component yourself and control its visibility. On iOS, wrap it in react-native-screens' `FullWindowOverlay` so it draws above the presented sheet: + +```jsx +import { useState } from "react"; +import { Button, Modal, Platform, StyleSheet, View } from "react-native"; +import { FeedbackForm } from "@sentry/react-native"; +import { FullWindowOverlay } from "react-native-screens"; + +function FeedbackButton() { + const [visible, setVisible] = useState(false); + const close = () => setVisible(false); + + // Pass the same options you'd give `feedbackIntegration(...)` + // (formTitle, namePlaceholder, styles, imagePicker, and so on). + const form = ( + + + + ); + + return ( + <> + - + + , so reset the UA styles back to the surrounding text + width: 100%; + border: none; + font: inherit; + color: inherit; + text-align: left; + &:hover { background-color: var(--item-hover-bg); } diff --git a/src/components/search/index.tsx b/src/components/search/index.tsx index af4d521ce8f39..1239e5a5fb91e 100644 --- a/src/components/search/index.tsx +++ b/src/components/search/index.tsx @@ -424,7 +424,7 @@ export function Search({ - or + or