Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Favicon does not use kit paths #3231

Closed
DblK opened this issue Jan 7, 2022 · 3 comments · Fixed by #3234
Closed

Favicon does not use kit paths #3231

DblK opened this issue Jan 7, 2022 · 3 comments · Fixed by #3234

Comments

@DblK
Copy link

DblK commented Jan 7, 2022

Describe the bug

When setting the following configuration for svelete:

...
kit: {
  ...
  paths: {
    base: '/admin'
  },
}

In the app.html there is the following line <link rel="icon" href="/favicon.png" />.
The %svelte.head% add the path while generating files but favicon is left untouched.

Reproduction

Simply create a new app and change the kit config as previously stated.

Logs

No response

System Info

System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
    Memory: 18.91 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
    npm: 7.24.0 - ~/.nvm/versions/node/v14.17.0/bin/npm
  Browsers:
    Chrome: 96.0.4664.110
    Firefox: 89.0.2
    Safari: 14.0.3
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.9 
    @sveltejs/adapter-static: ^1.0.0-next.24 => 1.0.0-next.24 
    @sveltejs/kit: next => 1.0.0-next.216 
    svelte: ^3.44.0 => 3.44.3

Severity

annoyance

Additional Information

To solve the issue I have to manually change the path for the favicon.
Since I do not know yet where I will serve my app, I will need to change the svelte config BUT also the app.html to avoid 404 error for favicon.

@ghostdevv
Copy link
Member

Very interesting to see where this issue will go, as app.html isn't processed and talks of potentially doing that occurred in #3127

I wonder what happens when you import a asset in one of your routes such as <img src="/favicon.png" /> if that image is also broken or if that url is processed

@Conduitry
Copy link
Member

I would suggest just putting the <link rel=icon> somewhere else where you do have access to the base information - like __layout.svelte, and then using https://kit.svelte.dev/docs#modules-$app-paths to construct the appropriate URL. I don't think it makes sense to make it any more complicated than that or to process app.html in some way.

I could go either way on whether the create-svelte template apps should be updated like this.

@Rich-Harris Rich-Harris linked a pull request Jan 7, 2022 that will close this issue
5 tasks
@Rich-Harris
Copy link
Member

This will be fixed by #3234 — just add %svelte.assets% to the template (i.e. %svelte.assets%/favicon.png)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants