I can't call .html and .js on vaadin kotlin

My project on Kotlin source

What version are you using? HtmlImport is a legacy feature which does not do what you think it does.

Please take a look at the docs how to use lit templates Template-based Components | Templates | Creating UI | Flow | Vaadin Docs

Screenshot 2024-10-04 112818
for my vaadin_version is 24.4.10 (latest) and kotlin_version is 2.0.20

.
can you help me, please

Please take a look at the documentation linked above - those are for 24.4

P.S. Spring Boot 3.1 is too old für Vaadin 24.4


yea, i was use lit element and npm but i get this error

which i run my project

Please take a close look at the documentation. You are duplicating the /frontend/ path - it’s automatically added to the path.

I’m sorry, I forgot about that.
but I’m still getting the error with the vite issue.

The real error should be at the bottom

thanks to you, but i still don’t know.

i got error : Could not navigate to ‘frontend/drawing.html’


in web app error
anyone can help me

If drawing.html is a static HTML file it should not go under frontend folder, but in a place where it can be served by the servlet container, for example src/main/resources/META-INF/resources/.
Take a look at the documentation for more information.

if so, i get a different error like this

How does the IFrame source look like now?
If you put the static file in src/main/resources/META-INF/resources/frontend/drawing.html, the source attribute should be /frontend/drawing.html (given that you are on the root context-path)

1 Like

initially, i tried to add vaadin plugin for frontend in build.gradle. and i have automatic frontend package on src/main

if i rename drawing.html to index.html which is in src/main/frontend/, it works but other admin.kt and main.kt files cannot be called.

It seems there might be some confusion about how Vaadin works, but I apologize in advance if I misunderstood your question.

When using Vaadin Flow, you are not supposed to create an HTML file for every view.
Usually, you’ll have an autogenerated index.html file that bootstrap the application in the browser, and then you navigate through views that you build in Java (or Kotlin in your case).
I would recommend checking out the tutorial and Building Apps The Vaadin Way, as they offer a great overview and might help clarify things.