koin icon indicating copy to clipboard operation
koin copied to clipboard

WASM: RuntimeError: dereferencing a null pointer

Open phansier opened this issue 5 months ago • 0 comments

Describe the bug

Trying to use Koin in WASM target of Compose and Kotlin multiplatform project. With manual dependecies providing - it works. With Koin I get the RuntimeError: dereferencing a null pointer

Stacktrace:

dereferencing a null pointer
RuntimeError: dereferencing a null pointer
    at <Coffeegram:cmp-common>.org.koin.core.module.flatten (http://localhost:8080/composeApp.wasm:wasm-function[24099]:0x45ca7b)
    at <Coffeegram:cmp-common>.org.koin.core.Koin.loadModules (http://localhost:8080/composeApp.wasm:wasm-function[23906]:0x45a077)
    at <Coffeegram:cmp-common>.org.koin.core.KoinApplication.loadModules (http://localhost:8080/composeApp.wasm:wasm-function[23922]:0x45a425)
    at <Coffeegram:cmp-common>.org.koin.core.KoinApplication.modules (http://localhost:8080/composeApp.wasm:wasm-function[23919]:0x45a3ec)
    at <Coffeegram:cmp-common>.org.koin.core.KoinApplication.modules (http://localhost:8080/composeApp.wasm:wasm-function[23917]:0x45a298)
    at <Coffeegram:cmp-common>.initKoin$lambda.invoke (http://localhost:8080/composeApp.wasm:wasm-function[63037]:0x7e27f3)
    at <Coffeegram:cmp-common>.initKoin$lambda.invoke (http://localhost:8080/composeApp.wasm:wasm-function[63038]:0x7e281d)
    at <Coffeegram:cmp-common>.org.koin.core.context.GlobalContext.startKoin (http://localhost:8080/composeApp.wasm:wasm-function[24248]:0x45fff3)
    at <Coffeegram:cmp-common>.org.koin.core.context.startKoin (http://localhost:8080/composeApp.wasm:wasm-function[23934]:0x45a582)
    at <Coffeegram:cmp-common>.initKoin (http://localhost:8080/composeApp.wasm:wasm-function[62999]:0x7e1b4b)

To Reproduce

Steps to reproduce the behavior:

  1. Checkout https://github.com/phansier/Coffeegram/tree/koin-wasm
  2. Run make runWasm
  3. App launches in browser, stacktrace displayed.

Expected behavior Dependencies tree resolved and app working You can rollback one commit or uncomment changes here to see it working without Koin.

Koin module and version: Tried 3.6.0-Beta2 and 4.0.0-RC2 and 4.0.0

Snippet or Sample project to help reproduce https://github.com/phansier/Coffeegram/tree/koin-wasm

phansier avatar Sep 16 '24 16:09 phansier