{"record":{"id":"f2b01c1111be44c9","repo":"dotnet/runtime","slug":"jsobject-proxy-is-not-supported-for-js-type-v","errorCode":null,"errorMessage":"JSObject proxy is not supported for ${js_type} ${value}","messagePattern":"JSObject proxy is not supported for (.+?) (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/mono/browser/runtime/marshal-to-cs.ts","lineNumber":430,"sourceCode":"                || value instanceof Int8Array\n                || value instanceof Uint8ClampedArray\n                || value instanceof Uint16Array\n                || value instanceof Uint32Array\n            ) {\n                throw new Error(\"NotImplementedException: TypedArray\");\n            } else if (isThenable(value)) {\n                marshal_task_to_cs(arg, value);\n            } else if (value instanceof Span) {\n                throw new Error(\"NotImplementedException: Span\");\n            } else if (js_type == \"object\") {\n                const js_handle = mono_wasm_get_js_handle(value);\n                set_arg_type(arg, MarshalerType.JSObject);\n                if (BuildConfiguration === \"Debug\" && Object.isExtensible(value)) {\n                    value[proxy_debug_symbol] = `JS Object with JSHandle ${js_handle}`;\n                }\n                set_js_handle(arg, js_handle);\n            } else {\n                throw new Error(`JSObject proxy is not supported for ${js_type} ${value}`);\n            }\n        } else {\n            assert_not_disposed(value);\n            if (value instanceof ArraySegment) {\n                throw new Error(\"NotImplementedException: ArraySegment. \" + jsinteropDoc);\n            } else if (value instanceof ManagedError) {\n                set_arg_type(arg, MarshalerType.Exception);\n                set_gc_handle(arg, gc_handle);\n            } else if (value instanceof ManagedObject) {\n                set_arg_type(arg, MarshalerType.Object);\n                set_gc_handle(arg, gc_handle);\n            } else {\n                throw new Error(\"NotImplementedException \" + js_type + \". \" + jsinteropDoc);\n            }\n        }\n    }\n}\n","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/mono/browser/runtime/marshal-to-cs.ts#L412-L448","documentation":"The final else in marshal_cs_object_to_cs fires when the JS value's typeof is not string, number, bigint, boolean, or object. In practice this means a Symbol or a Function passed where the C# parameter is object/JSObject, neither of which has an object-marshaler mapping.","triggerScenarios":"Passing a JS Symbol or a Function to a C# [JSExport] parameter typed as object/JSObject.","commonSituations":"Sending a callback function or a Symbol to a generic object parameter expecting a data object; forgetting to wrap a function in a JSObject-backed holder.","solutions":["For functions, pass them through a parameter typed to accept a JS function proxy, or wrap them in an object whose handle can be obtained.","Convert Symbols to strings; convert functions to a serializable representation or invoke them in JS and pass the result.","Type the C# parameter to match the actual JS value kind rather than object."],"exampleFix":"// before\ndotnet.jsExports.Take(Symbol('id')); // throws\n// after\ndotnet.jsExports.Take('id'); // pass a string","handlingStrategy":"type-guard","validationCode":"const t = typeof value;\nif (t === 'symbol' || t === 'function') {\n  throw new TypeError(`${t} is not supported by the object marshaler; convert to a supported type.`);\n}","typeGuard":"function isUnsupportedObjectKind(v: unknown): boolean { const t = typeof v; return t === 'symbol' || t === 'function'; }","tryCatchPattern":null,"preventionTips":["Do not pass Symbols or Functions to object/JSObject C# parameters.","Convert Symbols to strings; invoke functions in JS and pass their results.","Type C# parameters to match the actual JS value kind."],"tags":["marshaling","interop","types","symbol","function"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}