Skip to content

@sentry/sveltekit typescript types include unexported functions for Cloudflare Workers #24965

Description

@hmnd

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

10.75.3

Framework Version

SvelteKit 2.63.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

hooks.server.ts:

import * as Sentry from '@sentry/sveltekit';

export const handle = Sentry.initCloudflareSentryHandle({
  ...
  integrations: [
    Sentry.consoleLoggingIntegration(),
  ],
});

Steps to Reproduce

  1. Run a SvelteKit app with the above config on Cloudflare Workers

Expected Result

Works fine

Actual Result

Production down due to calling a non-existent function

Additional Context

The types provided by @sentry/sveltekit don't line up with what's exported when run in the workers runtime https://github.com/getsentry/sentry-javascript/blob/develop/packages/sveltekit/src/worker/index.ts. Because SvelteKit development usually happens on node, it's difficult to catch this before deploying live, unless you test against a workers runtime prior to deploy.

Handling workers the way it's done for eg. remix, which has a separate /cloudflare export under it would likely by ideal to avoid this kind of confusion.

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Activity

  1. linear-code commented on Oct 2, 2026

    @linear-code
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Oct 2, 2026
  3. JPeer264 commented on Oct 2, 2026

    @JPeer264
    Member

    Hey thanks for raising the issue. Do you have any specifics about which function is non-existing? We do have an E2E test in our repo that checks against workerd, just wondering if we missed something specific that lead to the crash.

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 2, 2026
  5. self-assigned this
    on Oct 2, 2026
  6. hmnd commented on Oct 2, 2026

    @hmnd
    Author

    Thanks for the quick reply. I encountered this specifically with consoleLoggingIntegration, as shown in my example; it's not exported from https://github.com/getsentry/sentry-javascript/blob/develop/packages/sveltekit/src/worker/index.ts. I was going to submit a pr to fix this, but I know some methods from core shouldn't be exposed to workers, and I was uncertain how best to handle the typing situation.

  7. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Oct 2, 2026
  8. JPeer264 commented on Oct 2, 2026

    @JPeer264
    Member

    I was going to submit a pr to fix this, but I know some methods from core shouldn't be exposed to workers, and I was uncertain how best to handle the typing situation.

    I see now. You're right the types are wrong, if you want you can add the consoleLoggingIntegration there. You don't have to deal/fix the types here, you can simply just add this one integration (I can then backport your PR to v10 and make a release).

    but I know some methods from core shouldn't be exposed to workers

    We had the rule of not importing everything in v10, as we still relied on nodejs_als as default, and not everything is available there. This also changed with v11 and have now better support for almost all integrations.


    I'm currently trying to have better support for frameworks on Cloudflare. I'll put it on my list together with this ticket #24841 to clean it up and try to make better types.

  9. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 2, 2026
  10. added a commit that references this issue on Oct 5, 2026
    e741ce8
  11. github-actions commented on Oct 7, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #25061, which was included in the 11.5.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions