-
Notifications
You must be signed in to change notification settings - Fork 57
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
Form validation does not work in Kotlin. #2343
Comments
Are there any updates for this Issue? |
Hi, one possible known cause is that Kotlin compiler requires specifying a flag for emitting annotations in JVM bytecode. Could you, please, try with the |
Hilla 2.5.7 also encountered this problem |
Oh. It works! I think it would be amazing if this was documented! This is a successful pom.xml file. ...
<build>
...
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<configuration>
<args>
<arg>-Xjsr305=strict</arg>
<arg>-Xemit-jvm-type-annotations</arg>
</args>
<compilerPlugins>
<plugin>spring</plugin>
<plugin>jpa</plugin>
</compilerPlugins>
</configuration>
... |
Successful! This is an example of the 'build.gradle.kts' file available: import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
// Omit content
kotlin("jvm") version "2.0.0"
}
// Omit content
java {
sourceCompatibility = JavaVersion.VERSION_21
}
kotlin {
compilerOptions {
freeCompilerArgs.add("-Xjsr305=strict")
freeCompilerArgs.add("-Xemit-jvm-type-annotations")
jvmTarget = JvmTarget.JVM_21
}
}
// Omit content Maybe we can modify the Gradle plugin to add this compilation option by default. |
@inithink: You can just do this:
|
Describe the bug
When I use Kotlin class for endpoint, validation does not work.
Expected-behavior
show errors in form
Reproduction
Repository
https://github.com/inithink/hilla-crm-tutorial.git
Kotlin
KotlinClass.kt
KotlinClassForm.tsx
Java
JavaClass.java
JavaForm.tsx
System Info
macOS 14.4.1(23E224), M1 Pro
hilla version: 2.5.6
browser: chrome 123.0.6312.124
The text was updated successfully, but these errors were encountered: