Relative paths for generated resources is wrong

Hello,

our app needs to run on different stages (dev, test, prod etc.). For reasons we can not change there are some network components involved which result in URLs having an extra path element.

Examples:

The path to the generated resources in VAADIN does not fit:
`

The relative path is resolved to:

Can this be configured somehow or what else can I do?

If you use spring boot: configure a proper contextPath for each instance.

I actually set a context path /myapp - so you say for the 2nd stage it should be /somepath/myapp?

The index file is found correctly, but the references do not fit (I just noticed that in my previous post this was removed):
< script type="module" crossorigin src="./VAADIN/build/indexhtml-BNpZk_Wn.js" >

Correct, otherwise it does not match and creates problems like shown above

I just tried that but it does not work. This extra somepath is not “actually” there, it is just inserted by a network component (reverse proxy or something like that).

Just for the records: it turned out that adding a slash to the URL (…/somepath/myapp/ instead of …/somepath/myapp) solved the issue. This usually happens automatically, but did not in this setup.