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

[Bug report] vite 5.2.12 failed to build dynamic imported style files #1573

Closed
Mister-Hope opened this issue May 31, 2024 · 5 comments
Closed
Assignees
Labels
package:bundler-vite upstream bug Bug from upperchain or other tools, env, etc.

Comments

@Mister-Hope
Copy link
Member

Mister-Hope commented May 31, 2024

Description

When building with vite 5.2.12, vuepress failed to externalize style imports like css or scss while preforming SSG

Reproduction

This is confirmed in our ecosystem and we are using pnpm.overrides to downgrade to 5.2.11

Used Package Manager

pnpm

Workaround for anyone

Use vite 5.2.11

@meteorlxy
Copy link
Member

Could you provide a reproduction based on our e2e? I could not reproduce it by 19e4d40

@Mister-Hope
Copy link
Member Author

Mister-Hope commented May 31, 2024

Could you provide a reproduction based on our e2e? I could not reproduce it by 19e4d40

The file should from a package, and it's imported using import()

import('@docsearch/css')
// or
import('@waline/client/waline-meta.css')

I am not sure if relative style files can cause this.

This is likely to be a Vite bug, but a normal Vite app do not have SSG process, so I have no idea making a minimal reproducion

@meteorlxy
Copy link
Member

Reproduced with e2e case.

@meteorlxy meteorlxy added upstream bug Bug from upperchain or other tools, env, etc. and removed need review labels May 31, 2024
@meteorlxy meteorlxy changed the title [Bug report] vite 5.2.12 broken with vuepress build [Bug report] vite 5.2.12 failed to build dynamic imported style files May 31, 2024
@meteorlxy
Copy link
Member

meteorlxy commented May 31, 2024

@Mister-Hope - I've exclude vite 5.2.12 as a workaround for now.

Alternatively, you may consider replacing the dynamic import with static import

@meteorlxy
Copy link
Member

vitejs/vite#17366

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:bundler-vite upstream bug Bug from upperchain or other tools, env, etc.
Projects
None yet
Development

No branches or pull requests

2 participants