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
- Create a new RN 0.81 app with New Architecture enabled
- Make any fetch() request (e.g., fetch('https://httpbin.org/get'))
- 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