{"record":{"id":"934b8258da91f24f","repo":"dotnet/runtime","slug":"notimplementedexception-jstype-for-more-inform","errorCode":null,"errorMessage":"NotImplementedException ${jsType}. For more information see https://aka.ms/dotnet-wasm-jsinterop","messagePattern":"NotImplementedException (.+?)\\. For more information see https://aka\\.ms/dotnet-wasm-jsinterop","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/marshal-to-cs.ts","lineNumber":414,"sourceCode":"                if (BuildConfiguration === \"Debug\" && Object.isExtensible(value)) {\n                    value[proxyDebugSymbol] = `JS Object with JSHandle ${jsHandle}`;\n                }\n                setJsHandle(arg, jsHandle);\n            } else {\n                throw new Error(`JSObject proxy is not supported for ${jsType} ${value}`);\n            }\n        } else {\n            assertNotDisposed(value);\n            if (value instanceof ArraySegment) {\n                throw new Error(\"NotImplementedException: ArraySegment. \" + jsinteropDoc);\n            } else if (value instanceof ManagedError) {\n                setArgType(arg, MarshalerType.Exception);\n                setGcHandle(arg, gcHandle);\n            } else if (value instanceof ManagedObject) {\n                setArgType(arg, MarshalerType.Object);\n                setGcHandle(arg, gcHandle);\n            } else {\n                throw new Error(\"NotImplementedException \" + jsType + \". \" + jsinteropDoc);\n            }\n        }\n    }\n}\n\nexport function marshalArrayToCs(arg: JSMarshalerArgument, value: Array<any> | TypedArray | undefined | null, elementType?: MarshalerType): void {\n    dotnetAssert.check(!!elementType, \"Expected valid elementType parameter\");\n    marshalArrayToCsImpl(arg, value, elementType);\n}\n\nexport function marshalArrayToCsImpl(arg: JSMarshalerArgument, value: Array<any> | TypedArray | undefined | null, elementType: MarshalerType): void {\n    if (value === null || value === undefined) {\n        setArgType(arg, MarshalerType.None);\n    } else {\n        const elementSize = arrayElementSize(elementType);\n        dotnetAssert.fastCheck(elementSize != -1, () => `Element type ${elementType} not supported`);\n        const length = value.length;\n        const bufferLength = elementSize * length;","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/marshal-to-cs.ts#L396-L432","documentation":"The final fallback in the GCHandle-holding branch of marshalCsObjectToCs: the value is a managed proxy (created by C#) but is neither ManagedError nor ManagedObject, so the runtime does not know how to type-tag it. jsType is included to aid diagnosis.","triggerScenarios":"A future/incompatible runtime version introduces a new managed proxy kind the JS side does not recognize, or an object's internal prototype got corrupted so instanceof checks for ManagedError/ManagedObject both fail.","commonSituations":"Mixing build artifacts from different .NET runtime versions (loader/runtime mismatch); monkey-patching prototype chains of managed proxies; using an experimental feature whose proxy type isn't wired into the object marshaler.","solutions":["Ensure the JS runtime library and the .NET WASM runtime come from the exact same build/version (re-clean and rebuild).","Avoid mutating prototype chains of objects returned from C#.","If you control the call, copy the data out of the proxy into a plain object before marshaling."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Hard to validate from user code; assert version integrity instead\nfunction assertRuntimeIntact() {\n    const ems: any = (globalThis as any).MONO?.ems;\n    if (!ems?.DOTNET_INTEROP?.gitHash) throw new Error(\"runtime/loader version mismatch\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    csharpApi.SendObject(proxy);\n} catch (e) {\n    if (String(e).includes(\"NotImplementedException\")) {\n        // copy data out of the proxy and retry with a plain object\n        csharpApi.SendObject({ ...extract(proxy) });\n    } else throw e;\n}","preventionTips":["Always pair loader and runtime from the same build.","Do not mutate prototypes of objects returned from C#.","Pin runtime versions in package.lock/package.json."],"tags":["marshaling","managed-proxy","interop","version-mismatch"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}