Skip to content

Sentry is not initialized on server-side for SSR Astro project #9463

Closed
@aldy505

Description

@aldy505

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/astro

SDK Version

7.77.0

Framework Version

3.4.2

Link to Sentry event

No response

SDK Setup

See repro below

Steps to Reproduce

See repro on https://github.com/aldy505/sentry-astro-endpoints-reproduction

Try for development build:

Run npm run dev, then curl http://localhost:4321/sentry-endpoints/hello. Check terminal/console, expect to see:

Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'

Then try for production build:

Run npm run build, execute NODE_ENV=production node ./dist/server/entry.mjs, then curl http://localhost:4321/sentry-endpoints/hello. Check terminal/console, expect to see:

Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'

Expected Result

Sentry is initialized and event is sent.

Actual Result

Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: astroIssues related to the Sentry Astro SDK

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions