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

UnoCSS in Astro project fails to include generated chunks under certain conditions #3748

Open
4 tasks done
duanwilliam opened this issue Apr 22, 2024 · 0 comments
Open
4 tasks done
Labels
astro help wanted Extra attention is needed

Comments

@duanwilliam
Copy link

UnoCSS version

0.59.4

Describe the bug

(already read through #1341, #1402)

In some set of conditions in an Astro project, generated chunk appears to not be included in the bundle, resulting in placeholder not being replaced and in turn the build failing.

[ERROR] [vite] x Build failed in 493ms
[unocss:global:build:bundle] [plugin unocss:global:build:bundle] [unocss] does not found CSS placeholder in the generated chunks
This is likely an internal bug of unocss vite plugin

I've tried narrowing reproduction but don't really understand what exactly the conditions are.

In reproduction there are several ways to work around, but they don't really apply in actual project, and I don't fully understand why the workarounds bring about the changes they do; from what I can tell it seems to be related to vite chunking / code splitting for different pages though.

Reproduction

https://stackblitz.com/edit/unocss-unocss-bpm7ur?file=README.md&view=editor

System Info

framework: Astro

Validations

@zyyv zyyv added astro help wanted Extra attention is needed labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astro help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants