-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
AgoraRTC SDK version
4.19.0
Fail Rate
100%
Link to minimal reproduction
Steps to reproduce
Description
- Using
@colyseus/schema@^3.0.0
together with any module from[email protected]
triggers the following error. - Even calling a single method—e.g.
AgoraRTC.setLogLevel(4);
—is enough to reproduce it. - Colyseus Schema’s
@type
decorator writes metadata toFunction.prototype[Symbol.metadata]
. - However, Agora’s SDK appears to freeze or override
Symbol.metadata
, preventing Colyseus from attaching decorator metadata. - As a result, when both libraries are imported, Colyseus’s attempt to write to
Symbol.metadata
fails with aTypeError
.
Reproduction
- Open the minimal StackBlitz project:
https://stackblitz.com/edit/vitejs-vite-p9wrtoyz?file=package.json,tsconfig.json,src%2Fmain.ts&terminal=dev - Click “Open Preview in New Tab” (top-right corner of the preview pane).
- Open DevTools in that new tab. You will immediately see the error in the console.
Error
index.js:950 Uncaught TypeError: Cannot assign to read only property 'Symbol(Symbol.metadata)' of function 'class MyTestState extends Schema {
constructor() {
super(...arguments);
this.testString = "test";
…<omitted>…
}
}'
at Object.initialize (index.js:950:40)
at index.js:2954:39
at __decorateClass (index.ts:7:24)
at index.ts:8:18
Key Questions
- Why does Agora’s SDK freeze or override
Symbol.metadata
? - Can that behavior be changed so it does not conflict with other decorator-based libraries like Colyseus Schema?
What is expected?
No crash
What is actually happening?
Crash
System Info
Any additional comments?
No response