-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Milestone
Description
Describe the bug
Using the preloadStrategy: 'preload-mjs' option causes the stylesheet <link> to be rendered with as="script".
<link rel="preload" as="script" crossorigin="anonymous" href="/_app/immutable/assets/0.r4pxjvvX.css">
This causes a flicker of unstyled content on first load.
This only seems to be a problem since SvelteKit 2.0
Reproduction
In sevelte.config.js:
output: {
preloadStrategy: 'preload-mjs'
},Generated index.html file:
<link rel="preload" as="script" crossorigin="anonymous" href="/_app/immutable/assets/0.r4pxjvvX.css">Logs
No response
System Info
System:
OS: macOS 14.2
CPU: (8) arm64 Apple M1
Memory: 78.63 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 21.4.0 - /opt/homebrew/bin/node
npm: 10.2.4 - /opt/homebrew/bin/npm
pnpm: 8.12.0 - /opt/homebrew/bin/pnpm
bun: 1.0.17 - /opt/homebrew/bin/bun
Browsers:
Chrome: 119.0.6045.159
Safari: 17.2
npmPackages:
@sveltejs/adapter-cloudflare: ^3.0.0 => 3.0.0
@sveltejs/kit: ^2.0.0 => 2.0.3
@sveltejs/vite-plugin-svelte: ^3.0.0 => 3.0.1
svelte: ^4.0.5 => 4.2.8
vite: ^5.0.0 => 5.0.10Severity
serious, but I can work around it
Additional Information
Workaround: use modulepreload as browser adoption is good enough by now.
Metadata
Metadata
Assignees
Labels
No labels