Skip to content

Event.NONE/CAPTURING_PHASE/AT_TARGET/BUBBLING_PHASE properties missing configurable: true breaks event-target-shim #54732

@ejkkan

Description

@ejkkan

Description

The new Event implementation in src/private/webapis/dom/events/Event.js (lines 186-231) defines phase constants (NONE, CAPTURING_PHASE, AT_TARGET,
BUBBLING_PHASE) without configurable: true or writable: true.

Since these default to false, the properties become non-configurable. This breaks event-target-shim (used by abort-controller, which is used by fetch()
internally), causing:

"Cannot assign to read-only property 'NONE'"

Fix: Add configurable: true, writable: true to all 8 Object.defineProperty calls.

Steps to reproduce

  1. Create a new RN 0.81 app with New Architecture enabled
  2. Make any fetch() request (e.g., fetch('https://httpbin.org/get'))
  3. Error: "Cannot assign to read-only property 'NONE'"

React Native Version

0.81.5

Affected Platforms

Runtime - Android, Runtime - iOS

Output of npx @react-native-community/cli info

Stacktrace:
  Uncaught Error
  Cannot assign to read-only property 'NONE'

  Call Stack:
  Event
  anonymous
  emit
  anonymous
  emit

Stacktrace or Logs

Stacktrace:
  Uncaught Error
  Cannot assign to read-only property 'NONE'

  Call Stack:
  Event
  anonymous
  emit
  anonymous
  emit

MANDATORY Reproducer

ReproducerNONE

Screenshots and Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Triage 🔍StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions