-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
preloaded with link preload was not used within a few seconds. Warning #7557
Comments
I don't think we can do much here. All modules related to the page are preloaded for maximum speed, and if some of them are not used right away that's probably better than loading them only when they are needed. I feel like it's safe to ignore this warning. |
I think this might actually be a problem — the files in question are getting loaded twice in Firefox. I believe it's something to do with Vite's module preloading, though I can't offer any specifics beyond that right now |
If it's the "loaded twice in Firefox" problem, that should've been fixed in Vite 3.2: #1042 (comment) |
I'm still seeing it on (for example) https://kit.svelte.dev, which is built with Vite 3.2. Something else must be afoot |
Hey, thanks for the replys. To give a bit of context: So I'm trying to teach myself SvelteKit by converting an existing Svelte based, single page PWA Project to it. There are a few (yet) unused components in there. Could that have something to do with it? The build is also forced to be hosted on an Apache2 + PHP + MySQL Server combo, so static is the only adapter I can use. And just to finish it. Please allow me to geek out for a second. |
This definitely comes from Vite. The
Further investigation has shown that Vite injects the preload helper somewhat like this: // before preload injection
() => import("./chunks/0-93be292d.js"),
// after preload injection
() =>
__vitePreload(
() => import('./chunks/0-93be292d.js'),
true
? [
'./chunks/0-93be292d.js',
'./chunks/_layout-8d2a742b.js',
'./components/pages/_layout.svelte-38c4a372.js',
'./chunks/index-e0f6e208.js',
'./chunks/stores-378bd268.js',
'./chunks/singletons-58fc2341.js',
'./chunks/navigation-420c33d4.js',
'./assets/SkipLink-c09ec3da.css',
'./chunks/SearchResults-463cedeb.js',
'./assets/SearchResults-f83a597b.css',
'./assets/_layout-abb1856d.css'
]
: void 0,
import.meta.url
); where |
I think we should turn off |
That's not what I'm seeing. If we disable module preloading, we'll be left with waterfalls. In Chrome, here's what the Here's Firefox: Note that the block of I'm left wondering if Vite should just not bother injecting |
You're right. I got confused by the change in the routing manifest. It works for me if we turn back on the polyfill. Any idea why that's disabled and can we just re-enable it? |
It adds bytes. Not a lot of bytes, but: https://guybedford.com/es-module-preloading-integrity#modulepreload-polyfill We need to figure out which we value more: shipping fewer bytes in browsers that support |
Vite claims to have a polyfill for this which would make it work for |
Yes, but we've disabled it. I sent a PR to turn it back on: #7770 The impact of a waterfall is somewhat substantial while the impact of the extra bytes is pretty minimal and non-detectable |
Describe the bug
On a Site build via @sveltejs/adapter-static
Firefox puts strange warnings into the console.
The resource at URL preloaded with link preload was not used within a few seconds. Make sure all attributes of the preload tag are set correctly.
URL means usually something like: https://[DOMAIN]/_app/immutable/chunks/1-b645c4a1.js
At first glance, this only seems to relate to files in the "_app/immutable" folder
Browser:
Firefox: 106.0.5 (64-Bit)
OS: Linux Mint 21
The strange thing is, that Chrome does not do this.
this is my package.json.
package.json.txt
Reproduction
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: