Repository navigation
[Docs] Example tunnel fails with compressed replay envelope #13453
Description
Activity
Hello, thanks for writing in.
The envelopes should not be empty for replays. You could add a guard to exit out early if
envelopeBytesis empty, but I'm curious why you're getting empty envelopes to begin with.Please set
debug: trueinSentry.initand paste your logs.- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3
on Aug 26, 2024 Yes the body of the request is there so I'm not sure why I can't get anything out of it on the server side.
Client side debug: https://gist.github.com/johnathanludwig/1bcefb76f2609a2b44eb3820dbdea26e
Server side:
Sentry Logger [log]: [Tracing] Starting sampled root span op: http.server name: GET /(unprotected)/login ID: 4e95db40cdd3ecc2 Sentry Logger [log]: [Tracing] Finishing "http.server" root span "GET /(unprotected)/login" with ID 4e95db40cdd3ecc2 Sentry Logger [log]: SpanExporter exported 1 spans, 0 unsent spans remaining Sentry Logger [log]: [Tracing] Starting sampled root span op: http.server name: POST /api/errors ID: 4d39a562acc53f42 Sentry Logger [log]: [Tracing] Inheriting parent's sampled decision for HTTP POST: true Sentry Logger [log]: [Tracing] Starting sampled span op: < unknown op > name: HTTP POST ID: b8cf5def993c2314 parent ID: 4d39a562acc53f42 root ID: 4d39a562acc53f42 root op: http.server root description: POST /api/errors Sentry Logger [log]: [Tracing] Finishing "< unknown op >" span "HTTP POST" with ID b8cf5def993c2314 Sentry Logger [log]: SpanExporter has 1 unsent spans remaining Sentry Logger [log]: [Tracing] Finishing "http.server" root span "POST /api/errors" with ID 4d39a562acc53f42 Sentry Logger [log]: SpanExporter exported 2 spans, 0 unsent spans remaining Sentry Logger [log]: Flushing client reports based on interval. Sentry Logger [log]: Flushing outcomes... Sentry Logger [log]: No outcomes to send Sentry Logger [log]: [Tracing] Starting sampled root span op: http.server name: POST /api/errors ID: 3bc95f07de7ced89 error tunneling to sentry SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at POST (/Users/johnathanludwig/git/frontend/apps/web/src/routes/api/errors/+server.ts:16:25) at async Module.render_endpoint (/Users/johnathanludwig/git/frontend/node_modules/.pnpm/@sveltejs+kit@2.5.18_@sveltejs+vite-plugin-svelte@3.1.1_svelte@4.2.18_vite@5.3.3_@types+node@_l5lnugt2i4tpym4dqtslohvg24/node_modules/@sveltejs/kit/src/runtime/server/endpoint.js:49:18) at async resolve (/Users/johnathanludwig/git/frontend/node_modules/.pnpm/@sveltejs+kit@2.5.18_@sveltejs+vite-plugin-svelte@3.1.1_svelte@4.2.18_vite@5.3.3_@types+node@_l5lnugt2i4tpym4dqtslohvg24/node_modules/@sveltejs/kit/src/runtime/server/respond.js:454:17) at async /Users/johnathanludwig/git/frontend/node_modules/.pnpm/@sentry+sveltekit@8.26.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemetry+a_gixmxtpq6bgq6uyfpgkkbh5rvy/node_modules/@sentry/sveltekit/build/cjs/server/handle.js:140:21 at async instrumentHandle (/Users/johnathanludwig/git/frontend/node_modules/.pnpm/@sentry+sveltekit@8.26.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemetry+a_gixmxtpq6bgq6uyfpgkkbh5rvy/node_modules/@sentry/sveltekit/build/cjs/server/handle.js:128:27) at async Module.respond (/Users/johnathanludwig/git/frontend/node_modules/.pnpm/@sveltejs+kit@2.5.18_@sveltejs+vite-plugin-svelte@3.1.1_svelte@4.2.18_vite@5.3.3_@types+node@_l5lnugt2i4tpym4dqtslohvg24/node_modules/@sveltejs/kit/src/runtime/server/respond.js:330:20) at async file:///Users/johnathanludwig/git/frontend/node_modules/.pnpm/@sveltejs+kit@2.5.18_@sveltejs+vite-plugin-svelte@3.1.1_svelte@4.2.18_vite@5.3.3_@types+node@_l5lnugt2i4tpym4dqtslohvg24/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:524:22 Sentry Logger [log]: [Tracing] Finishing "http.server" root span "POST /api/errors" with ID 3bc95f07de7ced89 Sentry Logger [log]: SpanExporter exported 1 spans, 0 unsent spans remainingCould you please amend the server side debug log with the logs that occur on app startup?
Also, does this happen if you disable compression?
Sentry.replayIntegration({ useCompression: false, });- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3
on Aug 26, 2024 33 remaining items
@jkittner do you mean the kitql proxy solution (#13453 (comment))? If so, I'm not entirely sure how the library handles proxying, so chances are that somewhere in there the compressed body is consumed and an error occurs?
I agree that the tunneling documentation is far from great and we need better examples. (Ideally, we can provide a
tunnelRouteoption just like in the NextJS SDK in more meta framework SDKs and a base proxy building block for lower level SDKs) Unfortunately, we didn't get to this yet, see #14248- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3
on Jun 6, 2025 Yes, the kitql solution only works w/o compression. For now disabling it solved the problem for me. I subscribed to the other issue as well.
- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3
on Jun 9, 2025 - changed the title
[-]Replay tunnel fails due to empty envelope[/-][+][Docs] Example tunnel fails with compressed replay envelope[/+]on Aug 5, 2025 Going to close this issue as the improvements necessary to fix are tracked in other issues.
- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3
on Aug 7, 2025
Metadata
Metadata
Assignees
Projects
- StatusShow more project fieldsNo status

Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/sveltekit
SDK Version
8.26.0
Framework Version
Sveltekit 2.5.18
Link to Sentry event
No response
Reproduction Example/SDK Setup
Using the example provided from the documentation does not work with replay requests. The docs show using an array buffer. This works well with traces, however for replays the code error on parsing
piece. In this case theenvelopeBytesis 0 andenvelopeempty.https://docs.sentry.io/platforms/javascript/troubleshooting/#dealing-with-ad-blockers
Steps to Reproduce
/api/errors/+server.ts./api/errors.Expected Result
The replays get sent to sentry successfully.
Actual Result
Traces are tunneled. Replays result in this error: