context path

I added a context-path to my vaadin app like setting the property

server.servlet.context-path=/demo

in application.properties.

This works. But the mapping for some js files like the sw.js is not set correctly and I get the following 404-error:
Failed to register/update a ServiceWorker for scope ‘http://localhost:8080/’: Load failed with status 404 for script ‘http://localhost:8080/VAADIN/static/server/workbox/workbox-sw.js’.

How can I fix this? There is also the folder (context path) missing in the url.