Skip to content

Link in html files are wrong for routes when using adapter-static #3014

@myhrmans

Description

@myhrmans

Describe the bug

When building using adapter-static and going to the output folder to check the index.html files you can see that the links
`

	<link rel="modulepreload" href="/_app/chunks/vendor-3d58c1d9.js">

	<link rel="modulepreload" href="/_app/chunks/preload-helper-ec9aa979.js">

	<link rel="modulepreload" href="/_app/chunks/singletons-ff603286.js">

	<link rel="stylesheet" href="/_app/assets/start-61d1577b.css">`

or in this case; the entire file is identical.
The links are relative but when creating routes they should be relative to where the index files are stored.

the viewed file in the below image is /_app/home/prototype/index.html but the links in it refer to /_app... but should be ../../../_app
image

Opening one of these index files will result in a "FILE_NOT_FOUND"

Reproduction

https://github.com/myhrmans/sveltekit-link-generation-bug

Logs

No response

System Info

System:
    OS: Linux 5.11 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Memory: 440.27 MB / 31.28 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.10 - /usr/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
  Browsers:
    Chrome: 96.0.4664.93
    Chromium: 96.0.4664.45
    Firefox: 95.0

Severity

blocking all usage of SvelteKit

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions