You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that if you use CSS url() property linking to an asset (be it relative or absolute path), it stops finding said asset if the page is rendered in a deep enough route (five or more levels).
<divclass="my-awesome-bg"></div>
<stylelang="scss">
.my-awesome-bg {width: 200px;height: 200px;// routes that would work:// e.g. "/", "/d1", "/d1/d2", "/d1/d2/d3", "/d1/d2/d3/d4"//// after 4th level of depth, image won't be found and will return 404.// e.g. "/d1/d2/d3/d4/d5", "/d1/d2/d3/d4/d5/d6", ...background: url('/images/bg.png') repeat; }
</style>
It does not happens in development mode, only after builds.
Was tested only building for adapter-node, not sure about other adapters.
Start navigating the deeper links, and hitting CMD+R/F5 (full page refresh) every time a page loads.
You should see CSS bg() issues on the 5th depth level route and beyond.
Logs
Listening on 0.0.0.0:3000
Error: Not found: /favicon-32.png
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3612:18)
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3479:34)
at Object.#options.hooks.handle (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3656:59)
at respond (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3477:43)
Error: Not found: /favicon-16.png
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3612:18)
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3479:34)
at Object.#options.hooks.handle (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3656:59)
at respond (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3477:43)
Error: Not found: /depth1/svelte-logo.svg
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3612:18)
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3479:34)
at Object.#options.hooks.handle (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3656:59)
at respond (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3477:43)
Error: Not found: /depth1/depth2/svelte-logo.svg
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3612:18)
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3479:34)
at Object.#options.hooks.handle (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3656:59)
at respond (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3477:43)
Error: Not found: /depth1/svelte-logo.svg
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3612:18)
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3479:34)
at Object.#options.hooks.handle (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3656:59)
at respond (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3477:43)
Error: Not found: /depth1/svelte-logo.svg
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3612:18)
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3479:34)
at Object.#options.hooks.handle (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3656:59)
at respond (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3477:43)
Error: Not found: /depth1/svelte-logo.svg
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3612:18)
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3479:34)
at Object.#options.hooks.handle (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3656:59)
at respond (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3477:43)
Error: Not found: /depth1/depth2/svelte-logo.svg
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3612:18)
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3479:34)
at Object.#options.hooks.handle (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3656:59)
at respond (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3477:43)
Error: Not found: /depth1/svelte-logo.svg
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3612:18)
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3479:34)
at Object.#options.hooks.handle (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3656:59)
at respond (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3477:43)
Error: Not found: /depth1/svelte-logo.svg
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3612:18)
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3479:34)
at Object.#options.hooks.handle (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3656:59)
at respond (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3477:43)
Error: Not found: /depth1/svelte-logo.svg
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3612:18)
at resolve (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3479:34)
at Object.#options.hooks.handle (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3656:59)
at respond (file:///Users/claudiojunior/Downloads/odd-behavior-css-url-sveltekit-main/build/server/index.js:3477:43)
Describe the bug
It seems that if you use CSS
url()
property linking to an asset (be it relative or absolute path), it stops finding said asset if the page is rendered in a deep enough route (five or more levels).It does not happens in development mode, only after builds.
Was tested only building for
adapter-node
, not sure about other adapters.Reproduction
Steps to reproduce:
npm install
andnpm run build
node build/index.js
bg()
issues on the 5th depth level route and beyond.Logs
System Info
Severity
serious, but I can work around it
Additional Information
Related discord link
The text was updated successfully, but these errors were encountered: