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

misc #443

Merged
merged 2 commits into from
Mar 4, 2021
Merged

misc #443

merged 2 commits into from
Mar 4, 2021

Conversation

Rich-Harris
Copy link
Member

fixes a couple of issues encountered in an app using kit@next:

  • the Vite SSR module graph doesn't distinguish between statically and dynamically imported modules, which (I think) somehow causes virtual CSS files to be requested when Kit tries to collect critical CSS for the page even though it's not available yet. I don't totally understand the mechanics of it, but bailing when Vite can't load the module in question fixes it
  • we don't have control over when the SSR module cache is invalidated in dev mode. This means that the effects of set_paths don't persist, which means that anything importing base or assets from $app/paths will get undefined values. Since custom base and assets values only make sense in a deployed app anyway, we can fix that by not calling set_paths in dev mode and instead initialising them with the expected values. Still need to find a solution to Some way to get advance warning of incorrect asset paths #326

} catch {
// this can happen with dynamically imported modules, I think
// because the Vite module graph doesn't distinguish between
// static and dynamic imports? TODO investigate, submit fix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we print a warning or something in the meantime so that if a user hits this they won't be totally stumped as to why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't want the user to be aware that this is happening

@Rich-Harris Rich-Harris merged commit 0c630b5 into master Mar 4, 2021
@Rich-Harris Rich-Harris deleted the vite-fixes branch March 4, 2021 22:41
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