Hi everyone, Im trying to inject a ViewModel in a...
# multiplatform
p
Hi everyone, Im trying to inject a ViewModel in a KMP - Web app but I am getting the exception
Copy code
IrLinkageError {message: "Function 'koinInject' can not be called: No functi…oser?;kotlin.Int;kotlin.Int){0§<kotlin.Any?>}[0]'", cause: undefined, name: 'IrLinkageError', stack: "IrLinkageError: Function 'koinInject' can not be c…latform-core-compose-material-material.js:2342:7)"}
Any insights in how to fix it?
p
You can put a link to this one in the #koin channel
p
Thanks did that
It could also help of someone knows of a working project that I can look at where it injects a View Model to a WEB KMP app
p
You are using
wasmJs
or plain
js
target? What navigation/state-management solution are you using?
p
Js
,
voyager-navigator
and
koin
ideally. But open to exploring different setups as well
p
I would ask/search in the voyager issues. Maybe someone hit the same problem already. All the popular ones support js, you can try PreCompose, I would say is the simplest out of decompose and circuit.
p
Hmm don’t think it’s the voyager. I’ve tried as well to inject a ViewModel to a simple composable without any navigation in it and got the same issue.
p
🤔 specific libraries have specific koin integrations. I would check the voyager koin integration module.
p
I’ll try that. But again I tried it to a simple composable without any reference to the voyager library and got the same : /
👍 1