Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/cloudflare
SDK Version
9.31.0
Framework Version
SvelteKit 2.16.0 - Svelte ^5.25.0 - Vite ^6.2.6
Link to Sentry event
No response
Reproduction Example/SDK Setup
Everything works fine locally sending errors and logs to Sentry, but when deployed to cloudflare pages (v3 runtime with node compat flag) the Sentry objected imported seems uninitialized with only the following 4 constants set, but no methods or other properties that are visible from the same console.log messages when I'm working locally.
import * as Sentry from "@sentry/sveltekit";
const { logger } = Sentry;
export const GET = async () => {
console.log("Sentry =>", Sentry);
console.log("Sentry logger =>", logger);
logger.info("Hello from Sentry! (server method)", {
requestId: "123",
});
throw new Error("Sentry Example API Route Error");
};
(log) Sentry => {
SDK_VERSION: '9.31.0',
SEMANTIC_ATTRIBUTE_SENTRY_OP: 'sentry.op',
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN: 'sentry.origen',
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE: 'sentry.sample_rate',
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE: 'sentry.source'
}
(log) Sentry logger => null
has anyone else encountered this??
I've got an isolated example that exhibits the same behavior i encountered when implementing this in my real project here: https://github.com/spacethree/cloudflare-sveltekit-sentry
Steps to Reproduce
- deploy https://github.com/spacethree/cloudflare-sveltekit-sentry to cloudflare pages
- visit the deployed site's /sentry-example-page
- click "throw sample error button"
Expected Result
- Sentry object is debug logged on server with real methods and properties
- Sentry logger method is debug logged on server
- "Hello from Sentry! (server method)" should be sent to sentry logging with example structured data attached
Actual Result
- Sentry object only has the 4 properties (see above)
- Sentry logger is null
- access violation attempting to call
logger.info
Metadata
Metadata
Assignees
Type
Projects
Status