Skip to content

Loader Script throws error when adding any Integration setting in code config, without it enabled in project settings #63085

@jgs-thg

Description

@jgs-thg

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

My org is looking to test Session Replays, to get better insight into our complex issues. We only want to log Errors, not general sessions, or dead/rage clicks, as we have a fairly large userbase, and the 10% default logging rate, will eat our budget/quota within 10-15 minutes.
So what we want to do, is adjust the setup of Session Replays, and push the setup to production, before enabling them in the project settings.
Unfortunately, adjusting the code config S, throws the error: You are using new Replay() even though this bundle does not include replay.. I think it should be possible to adjust the settings of an Integration in the Loader Script, without having the setting enabled, so that you can for a fact, deploy the settings to Production, before enabling the integration in the Projects settings.

Steps to reproduce:

  1. Add an Integration setting to the Sentry.init(), such as replaysSessionSampleRate: 0 or the below code, while Session Replay is disabled in Project settings:
integrations: [
  new Sentry.Replay({
    maskAllText: true,
  }),
],
  1. Note that Sentry now throws the below error from Replay.ts
    image

Expected Result

Sentry throws no error, and allows adjustment of settings before enabling Session Replays as an Integration in the Project Settings.
This will also mean that the quote from the docs, is slightly more accurate:

The Loader Script allows you to configure some SDK features from the Sentry UI, without having to redeploy your application.
If we were able to change the settings directly from the Project Settings, this would make sense, but if we can't change the settings, before enabling the Integration, then we have to Deploy with the error active.

Actual Result

Sentry throws the error You are using new Replay() even though this bundle does not include replay. when enabling any setting related to it, without it enabled in the Project Settings:
image
image
image

Product Area

Replays

Link

No response

DSN

No response

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions