I am trying to use Spring Boot Security for Vaadin Flow with a newly create

I am trying to use Spring Boot Security for Vaadin Flow with a newly created Vaadin 17.0.7 application. Platform: macOS + Java 15 + Brave browser.

When submitting the login form, I get the following errors in the browser:

(ReferenceError): ajax is not defined
Error loading http://localhost:8080/src/js/miniAjax.min.js

The browser’s JavaScript console shows (see attached screenshot):

Refused to execute script from 'http://localhost:8080/src/js/miniAjax.min.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Any thoughts would be much appreciated.
18463481.png

My addon is trying to load a small JavaScript file using
ui.getPage().addJavaScript("./src/js/miniAjax.min.js");

Vaadin 14 turns this into the correct URL
<servletcontext>/frontend/src/js/miniAjax.min.js.

But Vaadin 17 turns it into
<servletcontext>/src/js/miniAjax.min.js
where the script isn’t found.

Not sure what to do about it. I’m doing it based on [Storing and Loading Resources, Table 3. Add-ons]
(https://vaadin.com/docs/v17/flow/importing-dependencies/tutorial-ways-of-importing.html#resource-cheat-sheet), but apparently that doesn’t work anymore. Maybe it’s a bug in Vaadin 17.

After a bit more research: We still have a frontend folder (at least by convention), but the frontend protocol which was used implicitly for relative URLs like mine, simply doesn’t exist anymore…not sure what that’s about. Seems like a change that could break a lot of stuff.

Anyway, I found a solution. Check out version 0.9.2.

\u0000Hi Patrick,\n\nFix confirmed. \uD83D\uDC4D\uD83C\uDFFB That’s really great. \uD83D\uDE4F\uD83C\uDFFB\n\nBest, Mark

Great :) Let me know how this addon works out for you.