Skip to content

Bug: Devtools conceal lack of setImmediate polyfill #18853

Closed
@matt-tingen

Description

@matt-tingen

React version: N/A; sample app uses 16.13.1
Devtools version: 6cceaeb on FF and Chrome

Steps To Reproduce

Generally speaking:

  1. Call setImmediate in a react app without a polyfill after react devtools have initialized.

To demonstrate in the sample app:

  1. Open sample app with browser devtools closed.
  2. Click button and observe that setImmediate is not defined initially or after mounting react.
  3. Open browser devtools to allow react devtools extension to initialize.
  4. Click button and observe that setImmediate has been defined.

Link to code example:

I couldn't figure out how to prevent polyfills from being included on CodeSandbox.
js bin editor
repro page

The current behavior

React devtools globally defines a polyfill for setImmediate, masking the problem.

The expected behavior

Usage of setImmediate without a polyfill in an app will throw an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions