Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AfterHotReloadEffect swallows 'NoSuchMethodError' #66

Open
sellmair opened this issue Jan 24, 2025 · 0 comments
Open

AfterHotReloadEffect swallows 'NoSuchMethodError' #66

sellmair opened this issue Jan 24, 2025 · 0 comments

Comments

@sellmair
Copy link
Member

This is because of the simple way 'AfterHotReloadEffect' handles itself being removed.
Right now, removing the 'AfterHotReloadEffect' from a composable

e.g. from

@Composable
fun SomeWidget() {
    AfterReloadEffect { println("Hello") }
    Text("Hello")
}

to

@Composable
fun SomeWidget() {
    // AfterReloadEffect { println("Hello") }
    Text("Hello")
}

will still have the listener instance registered, trying to call the stastic lambda method potentially resulting in
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: 'kotlin.Unit SomeWidgetKt.SomeWidget$lambda$1$lambda$0().

Therefore, the 'AfterHotReloadEffect' will ignore such linkage errors, assuming that it is invalid now.

A better solution has to be found which will not swallow user space linkage errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant