Skip to content

Is it possible to output a warning "No Fetch API detected."? #16284

Closed

Description

@jihea-park

Description

https://github.com/getsentry/sentry-javascript/blob/develop/packages/browser/src/sdk.ts#L190

I am studying sentry/browser code.

Initially, logger.enabled is set to false.

In the initAndBind function of sentry/core, logger.enable() is called, and the logger is enabled from then on.

However, logger.warn('No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill.',); exists above the initAndBind function.

Is it possible to output a warning "No Fetch API detected."?

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on May 14, 2025
  2. mydea commented on May 14, 2025

    @mydea
    Member

    We do not officially support any environments where fetch is not supported. Why would you need/want such a warning? Do you expect this to not be supported somewhere? I was actually thinking about removing this warning all together 🤔 (as this will trigger a warning/error/log anyhow once the SDK tries to send something to sentry and encounters fetch not existing)

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on May 14, 2025
  4. jihea-park commented on May 15, 2025

    @jihea-park
    Author

    @mydea
    I was just studying your code and found that line wasn't doing anything.

  5. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on May 15, 2025
  6. mydea commented on May 15, 2025

    @mydea
    Member

    you are right! We'll remove this line altogether probably.

  7. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on May 15, 2025
  8. self-assigned this
    on May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions