Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(vite): don't fail builds for virtual modules that don't support inlining #7440

Merged
merged 5 commits into from
Sep 12, 2022

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves nuxt/nuxt#14855

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Virtual CSS files that want Nuxt inline styles need to respond to the resolved ID with the correct query flags (?inline&used). I've updated three key virtual CSS modules (see linked issue). But we shouldn't fail builds if user is using some other virtual CSS module; this PR simply makes sure we skip those virtual modules. Any CSS they inject will not be inlined.)

We could also display a warning message so users at least know this is happening and know where to raise an issue. wdyt @pi0?

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added bug Something isn't working vite ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf labels Sep 12, 2022
@danielroe danielroe requested a review from pi0 September 12, 2022 11:32
@danielroe danielroe self-assigned this Sep 12, 2022
@netlify
Copy link

netlify bot commented Sep 12, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit d726328
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/631f40e93d4242000891307d

@pi0
Copy link
Member

pi0 commented Sep 12, 2022

A warning when bailing inlining because of unsupported query seems nice idea πŸ‘πŸΌ This way we can signal plugin authors to add support.

@pi0 pi0 merged commit 9382b42 into main Sep 12, 2022
@pi0 pi0 deleted the fix/virtual-inline-styles branch September 12, 2022 15:14
This was referenced Sep 14, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x bug Something isn't working ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf vite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

virtual css modules not working with inlineSSRStyles (on edge)
2 participants