Hi everyone, I’m trying to develop a web app with ...
# webassembly
i
Hi everyone, I’m trying to develop a web app with KMP. When I launch the WASM app and point to localhost:8080, everything works perfectly. However, if I open the application by pointing to my machine’s IP, I get this error:
ERROR
_this.randomUUID is not a function
TypeError: _this.randomUUID is not a function
at kotlin.uuid.randomUUID_$external_fun (webpack-internal:///./kotlin/composeApp.uninstantiated.mjs:182:69)
at <GT:composeApp>.kotlin.uuid.randomUUID_$external_fun__externalAdapter (<http://10.131.12.146:8080/composeApp.wasm:wasm-function[13724]:0x4f24fa>)
at <GT:composeApp>.kotlin.uuid.secureRandomUuid (<http://10.131.12.146:8080/composeApp.wasm:wasm-function[13722]:0x4f24cd>)
at <GT:composeApp>.kotlin.uuid.Companion.random (<http://10.131.12.146:8080/composeApp.wasm:wasm-function[12145]:0x4e2be1>)
at <GT:composeApp>.org.koin.mp.generateId (<http://10.131.12.146:8080/composeApp.wasm:wasm-function[16356]:0x51c68c>)
at <GT:composeApp>.org.koin.core.module.Module.<init> (<http://10.131.12.146:8080/composeApp.wasm:wasm-function[16181]:0x51829b>)
at <GT:composeApp>.org.koin.dsl.module (<http://10.131.12.146:8080/composeApp.wasm:wasm-function[16346]:0x51c4f4>)
at <GT:composeApp>.org.koin.dsl.module$default (<http://10.131.12.146:8080/composeApp.wasm:wasm-function[16347]:0x51c53d>)
at <GT:composeApp>.me.iseb.gametool.di.AppModule.<init> (<http://10.131.12.146:8080/composeApp.wasm:wasm-function[72197]:0x9edfcc>)
at <GT:composeApp>.me.iseb.gametool.di.initKoin$lambda.invoke (<http://10.131.12.146:8080/composeApp.wasm:wasm-function[72205]:0x9ee096>)
Any idea?
b
randomUUID is available only in secure contexts (HTTPS)
👍 1
today i learned 1
Some browsers may allow using on
localhost
, others may not.
i
ah ok great, good to know. thank you very much!
b
you can polyfill/mock it for localhost