Skip to content

Preload settings affect stylesheet loading for current page #8238

Closed
@arackaf

Description

@arackaf

Describe the bug

With the following content in hooks.server.ts

export async function handle({ event, resolve }: any) {
  const response = await resolve(event, {
    preload: ({ type }: any) => type === "font"
  });

  return response;
}

after an npm run build and npm run preview, running the page shows needed stylesheets are not loaded into , causing FOUC.

Adding a preload for css fixes it (or just not including any preload at all)

image

Reproduction

See code above - hopefully that's sufficient

Logs

No response

System Info

System:
    OS: macOS 13.0.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 1.09 GB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/Cellar/nvm/0.38.0/versions/node/v16.14.2/bin/node
    Yarn: 1.22.17 - /usr/local/Cellar/nvm/0.38.0/versions/node/v16.11.1/bin/yarn
    npm: 9.2.0 - ~/Documents/git/booklist/svelte-kit/node_modules/.bin/npm
  Browsers:
    Chrome: 108.0.5359.124
    Firefox: 108.0.1
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.89 
    @sveltejs/kit: ^1.0.1 => 1.0.1 
    svelte: ^3.44.0 => 3.54.0 
    vite: ^4.0.1 => 4.0.1

Severity

serious, but I can work around it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions