https://kotlinlang.org logo
#webassembly
Title
# webassembly
r

Robert Jaros

03/05/2024, 8:18 AM
There is
org.w3c.fetch.RequestInit()
defined in stdlib like this: https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/wasm/js/src/org.w3c/org.w3c.fetch.kt#L107 But as
undefined
is
null
on Wasm, the generated object contains nulls and the browser doesn't like it:
Copy code
Exception: TypeError: Window.fetch: 'null' (value of 'cache' member of RequestInit) is not a valid value for enumeration RequestCache.
5 Views