flow icon indicating copy to clipboard operation
flow copied to clipboard

Since 24.3 links in index.html get prefixed with /VAADIN/

Open HerbertsVaadin opened this issue 3 months ago • 1 comments

Description of the bug

When adding a link in index.html

<link rel="icon" type="image/x-icon" href="frontend/images/favicon/favicon.svg" />

in V24.3 it gets prefixed with /VAADIN/ path, resulting in

<link rel="icon" type="image/x-icon" href="/VAADIN/frontend/images/favicon/favicon.svg" />

in the page.

image

Expected behavior

Custom links do not get prefixed with /VAADIN/ context.

Minimal reproducible example

<!DOCTYPE html>
<!--
This file is auto-generated by Vaadin.
-->

<html>
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <link rel="icon" type="image/x-icon" href="frontend/images/favicon/favicon.svg" />
  <link rel="mask-icon" href="maskicon.png" color="#000000" />
  <link rel="apple-touch-icon" href="tomato/soup/apple.png" />
  <style>
    body, #outlet {
      height: 100vh;
      width: 100%;
      margin: 0;
    }
  </style>
  <!-- index.ts is included here automatically (either by the dev server or during the build) -->
</head>
<body>
  <!-- This outlet div is where the views are rendered -->
  <div id="outlet"></div>
</body>
</html>

Versions

  • Vaadin / Flow version: 24.3
  • Java version: 17
  • OS version: Windows 11

HerbertsVaadin avatar Mar 25 '24 08:03 HerbertsVaadin

Workaround 1:

Put the files in in VAADIN folder: META-INF/resources/VAADIN/frontend/images/favicon/favicon.svg

Workaround 2:

Use AppShellConfigurator to add links instead.

public class Application implements AppShellConfigurator {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Override
    public void configurePage(AppShellSettings settings) {
        settings.addLink("fav2", "frontend/images/favicon/favicon.svg");
    }
}

HerbertsVaadin avatar Mar 25 '24 08:03 HerbertsVaadin