Skip to content

fix(plugin-vue): suppress spammy lightningcss warnings with new tag#753

Closed
matthewwithanm wants to merge 1 commit intovitejs:mainfrom
matthewwithanm:lightningcss-minify-warnings
Closed

fix(plugin-vue): suppress spammy lightningcss warnings with new tag#753
matthewwithanm wants to merge 1 commit intovitejs:mainfrom
matthewwithanm:lightningcss-minify-warnings

Conversation

@matthewwithanm
Copy link
Copy Markdown

Description

Discussed previously in both #507 and #594, lightningcss has some noisy warnings about (apparently) expected invalid CSS.

After upgrading to Vite 8, I'm seeing them again with a slight variation: the message now starts with "[lightningcss minify]" instead of just "[lightningcss]", so the existing RegExp no longer matches.

I'm not clear on why the invalid selectors are included in the first place, but when I reverted to Vite 7 they were there too so I guess this is expected behavior?

Apologies in advance if I'm missing something!

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

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

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Discussed previously in both vitejs#507 and vitejs#594, lightningcss has some
noisy warnings about (apparently) expected invalid CSS.

After upgrading to Vite 8, I'm seeing them again with a slight
variation: the message now starts with "[lightningcss minify]" instead
of just "[lightningcss]", so the existing RegExp no longer matches.

I'm not clear on why the invalid selectors are included in the first
place, but when I reverted to Vite 7 they were there too so I guess this
is expected behavior?
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 29, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@vitejs/plugin-vue@753
npm i https://pkg.pr.new/@vitejs/plugin-vue-jsx@753

commit: 31fdb00

@edison1105 edison1105 changed the title fix: Suppress spammy lightningcss warnings with new tag fix(plugin-vue): suppress spammy lightningcss warnings with new tag Mar 29, 2026
@sapphi-red
Copy link
Copy Markdown
Member

I would expect the vue specific selectors (:deep, :slotted, :global) to be transformed before the CSS is minified. Would you be able to provide a reproduction?

@matthewwithanm
Copy link
Copy Markdown
Author

@sapphi-red Thanks for the reply! Yeah, that's I expected but I was thrown by the fact that the selectors were present in the Vite 7 output and assumed I didn't understand the expected behavior. 😅

This was the result of using an scss mixin that contains :deep inside of a :deep selector. The mixin in question was intended (as I understand it) to be usable inside both normal selectors and :deep, so it included both and relied on the redundant one having no effect. Vite 7 was letting it through silently (producing invalid CSS), whereas after the upgrade, lightningcss produced this warning.

Going to close this PR.

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