Skip to content
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

attempt to fix dev mode FOUC #1031

Closed
wants to merge 1 commit into from
Closed

attempt to fix dev mode FOUC #1031

wants to merge 1 commit into from

Conversation

Rich-Harris
Copy link
Member

Alternative to #1026. It seems to work for apps once they're running, but the first load after the server starts always results in this:

image

I have no idea why — @dominikg does this look familiar?

admin

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpx changeset and following the prompts

@dominikg
Copy link
Member

Source for that error:
https://github.com/sveltejs/vite-plugin-svelte/blob/46c27500e10aa97dd8ff6a5d6fc80d110c36cdc8/packages/vite-plugin-svelte/src/index.ts#L195

I think whats happening is that there are 2 caches for svelte compile data and the css is only checked in one. It gets added to the ssr cache during ssr render pass, but when the browser requests the css via the injected link, its a client request and transform is called with ssr=false. -> cache miss for the module css and error.

@Rich-Harris
Copy link
Member Author

closing in favour of #1057

@Conduitry Conduitry deleted the vite-css-fix branch April 16, 2021 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants