sveltejs / kit

web development, streamlined
https://svelte.dev/docs/kit
MIT License
18.78k stars 1.96k forks source link

Make `%sveltekit.assets%` placeholder available to `src/error.html` page #12712

Open vijay8i opened 2 months ago

vijay8i commented 2 months ago

Describe the problem

It is not uncommon to share global style sheets for various pages of a site. SvelteKit provides %sveltekit.assets% placeholder to src/app.html but not to src/error.html. IMHO error pages should also share the same theme as the rest of the application/site, and so it comes as a surprise to discover that I cannot access the global stylesheets using %sveltekit.assets%. I am failing to see the reason as to why it is not made available in this context.

Describe the proposed solution

I would like to see %sveltekit.assets% made available to src/error.html page as well.

My first thought was to figure out where these placeholders are replaced and fix it. But thought I should ask if there is a reason for the omision.

The fix I have feels out of place but it is to simply use the src relative absolute path. Which implies that if I change the location of my assets folder, then I have to remember to go fix my error.html page, which is not ideal.

Alternatives considered

Get into the codebase and fix it!

Importance

would make my life easier

Additional Information

No response

vijay8i commented 2 days ago

@eltigerchino now that the issue has been triaged to be a feature/enhancement, is this something for which a PR might be accepted? TIA.

eltigerchino commented 2 days ago

@eltigerchino now that the issue has been triaged to be a feature/enhancement, is this something for which a PR might be accepted? TIA.

I think it's something that still needs to be discussed first.