Open medz opened 1 month ago
This is very different from #1287. In the case of nuxi dev
, the styles of all components and pages are loaded, so the style lag problem will no longer occur after the fix in #1287.
But the SSR app compiled by nuxi build
still exists.
Environment
Build Modules: -
Reproduction
Nuxt Bridge:https://stackblitz.com/~/github.com/medz/github-avnkvf - ❌ Nuxt 3: https://stackblitz.com/~/github.com/medz/github-8bvs9l - ✅
Describe the bug
After running
nuxi build
, components or page styles are not extracted correctlyAdditional context
Nuxt Bridge:
Nuxt 3:
Desc
By comparing the output of Nuxt Bridge and Nuxt 3, it is found that Nuxt Bridge does not extract css correctly, which causes the page style to be applied later.
Through the browser execution order, it is found that in Nuxt Bridge, the browser needs to download the component or page JS before applying the style in JS.
Correct behavior
Entering the page, the page and component styles should be extracted to the head (external css should set the correct link) but Nuxt Bridge + vite does not
Logs
No response