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/vite may failed to compile due to confusion of cssPlugin during parallel builds in renderChunk #1065
Comments
…issue when transforming (unocss#1065)
…issue when transforming (unocss#1065)
After checking ;[clientOutput, serverOutput] = await Promise.all([
viteBuild(clientConfig) as Promise<RollupOutput>,
viteBuild(serverConfig) as Promise<RollupOutput>,
]) This will confuse vite plugin because we only preserve one When running It can be fixed by using Hope it helps. |
Confirmed fixed in 0.38.1. Thanks @antfu ! |
Hi,
I'm trying to integrate unocss with vuepress-next. But I failed to build the site with
npm run build
. Dev mode is fine and everything just works.Reproducible StackBlitz: https://stackblitz.com/edit/vuepress-vxrzqi?file=package.json
Reproduce Repo: https://github.com/Cubelrti/vuepress-unocss-repro
It produces the following error(if you don't encounter this, refresh stackblitz then try again):
However, this error is not always reproduced in my own machine (or CICD pipeline), seems to be flaky that if you retry for a couple of times, it will succeed.
Seems to be related to vite, but i'm not sure.
EDIT: some digging FYI
TypeError occurs in
transform
method of vite when transformingassets/HomeLayout.${hash}.js-unocss-hash.css
cssModulesCache
is defined in global scope withconst cssModulesCache = new WeakMap();
and is initialized by
buildStart()
withcssModulesCache.set(config, moduleCache);
after a successful
vuepress dev docs
thenvuepress build docs
then the error is gone.The text was updated successfully, but these errors were encountered: