Loading Resources

I’m trying to import a javascript file in my Spring Boot/Vaadin project. I have tried every possible way but nothing works. I have created the following directories:

root/frontend/src/script.js
root/src/main/frontend/src/script.js
root/src/main/resources/META-INF/resources/src/script.js
root/src/main/resources/static/src/script.js

I’m including it this way @JavaScript(“./src/script.js”) in the view and executing it this way getElement().executeJs(“jsmethod()”);

What am I missing here?

root/src/main/frontend/src/script.js should be the right location. Check that it’s getting loaded with the highly advanced alert("here") debugging technique :slight_smile:

If it is, how are you defining the function?