voyager
voyager copied to clipboard
Kotlin JS - IrLinkageError - Function 'Navigator' can not be called: No function found for symbol
Hello, I am trying to work with Voyager on a Compose Web project, but I am getting an issue at runtime.
"Function 'Navigator' can not be called: No function found for symbol
'cafe.adriel.voyager.navigator/Navigator|Navigator(cafe.adriel.voyager.core.screen.Screen;cafe.adriel.voyager.navigator.NavigatorDisposeBehavior?;kotlin.Function1<cafe.adriel.voyager.core.screen.Screen,kotlin.Boolean>?;kotlin.String?;kotlin.Function3<cafe.adriel.voyager.navigator.Navigator,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]'"
Here is my gradle.build.kts
:
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.jetbrainsCompose)
}
kotlin {
js(IR) {
browser()
binaries.executable()
}
sourceSets {
jsMain.dependencies {
implementation(kotlin.compose.html.core)
implementation(kotlin.compose.runtimeSaveable)
implementation(libs.voyager.navigator)
}
}
}
compose.experimental {
web.application {}
}
And my main.kt
file:
import androidx.compose.runtime.Composable
import cafe.adriel.voyager.core.screen.Screen
import cafe.adriel.voyager.navigator.Navigator
import org.jetbrains.compose.web.dom.H1
import org.jetbrains.compose.web.dom.Text
import org.jetbrains.compose.web.renderComposableInBody
fun main() {
renderComposableInBody {
// H1 { Text("Voyager Test App") }
Navigator(HomeScreen)
}
}
object HomeScreen : Screen {
@Composable
override fun Content() {
H1 { Text("Voyager Test App") }
}
}
Here is a reproducer based on a https://kmp.jetbrains.com template.
I checked your sample project multiplatform
, that works, but was getting the same issue by copy / pasting your code inside my project. Not sure of what's going on here.
The reason is: the voyager have to use the compose multiplatform version 1.6.0-beta01
or higher
Hi I have the same issue, but using 1.6.0-rc02
Compose Multiplatform version. Works great with Android, Desktop targets, but getting the same error on Web.
Project: https://github.com/HLCaptain/butler/tree/64d0413de58ea3c91d3827bdfceea38a18ac1853
Same here, it's not working on Compose Multiplatform v1.6.0-rc02
Same here v1.6.0-rc03
@DevSrSouza Please can you help us with this?
Should be fixed on https://github.com/adrielcafe/voyager/releases/tag/1.1.0-alpha03
We have update Compose KMP and add WASM support.
https://github.com/JetBrains/compose-multiplatform/issues/4361 still cannot build
Just getting back at my sample project and it works.
Here is the toml updated:
[versions]
jbCompose = "1.6.0"
kotlin = "1.9.22"
voyager = "1.1.0-alpha03"
[libraries]
voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" }
[plugins]
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "jbCompose" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
Thanks for the work on voyager!