Skip to content

sentry.server.config.js fills up with globalThis #17179

Closed

Description

@johnnydecimal

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/astro

SDK Version

9.41.0

Framework Version

Astro 5.12.3

Link to Sentry event

No response

Reproduction Example/SDK Setup

https://github.com/johnnydecimal/astro-sentry

Steps to Reproduce

  1. Run npm run astro check, or a build.
  2. Check sentry.server.config.js.
  3. Do it again and watch the globalThis entries just pile up.

Expected Result

I don't know if we're expecting a single globalThis block there? Presumably it has some purpose? But we definitely aren't expecting them to just be concatenated to the end.

FWIW mine are 350+ lines long each. The file grows out of control real fast.

Actual Result

As above.

Activity

  1. linear commented on Jul 26, 2025

    @linear
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 26, 2025
  3. johnnydecimal commented on Jul 26, 2025

    @johnnydecimal
    Author

    Note that the example repo has 9.42.0 but I confirmed that this change occurred at 9.41.0.

    Ah here we go. Commit 726c86842915111bca94d3787bc203ba05cd07e7 introduced this:

    const updatedServerInitContent = `${serverInitContent}\nglobalThis["__sentryRouteInfo"] = ${JSON.stringify(

    To my untrained eye it's not checking whether that already exists. Hence every time you just get a new block.

    I'd offer to PR this but believe me you don't want my code.

  4. chargome commented on Jul 28, 2025

    @chargome
    Member

    @johnnydecimal thanks for reporting!

    cc @s1gr1d this comes from the parameterized routes PR I assume?

  5. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 28, 2025
  6. s1gr1d commented on Jul 28, 2025

    @s1gr1d
    Member

    Hello and thanks for raising this. I reverted the changes for now and we will release this as soon as possible.

  7. s1gr1d commented on Jul 28, 2025

    @s1gr1d
    Member

    This is released in 9.42.1.

  8. github-actions commented on Jul 31, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #17190, which was included in the 10.0.0 release.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions