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

vite 2.3.8 breaks CSS imports from node_modules #3945

Closed
leroytromp opened this issue Jun 24, 2021 · 6 comments
Closed

vite 2.3.8 breaks CSS imports from node_modules #3945

leroytromp opened this issue Jun 24, 2021 · 6 comments
Labels
pending triage regression The issue only appears after a new release windows only

Comments

@leroytromp
Copy link

Describe the bug

After upgrading to vite 2.3.8, CSS imports from node_modules no longer work as before. The styles are loaded, but any fonts, icons, etc. that are referenced in the imported CSS file, silently fail to load. Downgrading to vite 2.3.7 solves the issue.

Reproduction

Here is a small repo that illustrates the problem:

https://github.com/leroytromp/vite-css-import-issue

System Info

Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:

  System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
    Memory: 1.52 GB / 7.84 GB
  Binaries:
    Node: 14.17.1 - C:\Program Files\nodejs\node.EXE
    npm: 7.17.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 91.0.4472.114
    Edge: Spartan (44.19041.964.0), Chromium (91.0.864.54)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    vite: ^2.3.8 => 2.3.8

Used package manager: npm

Logs

No errors are are shown in the browser console or server logs around the time this bug occurred.

@aicing
Copy link

aicing commented Jun 25, 2021

我也遇到这个问题了,还以为 是 Element Plus的问题呢 ^_^
也是降级到 v2.3.7解决的

@DreierF
Copy link
Contributor

DreierF commented Jun 27, 2021

I tried to reproduce the issue with the supplied repository, but it works for me running

npm install
npm run build
npx serve dist

The icons show up as expected AFAICS
image

I'm running on MacOS, so this might be a Windows specific issue.

@leroytromp
Copy link
Author

@DreierF then it indeed seems to be a Windows specific issue, because executing the same commands that you did, gives me an incorrect font and missing icons.

Schermopname (193)

@dbpolito
Copy link

dbpolito commented Jun 28, 2021

I can reproduce this on Mac, i use a project with ElementUI and it's fonts stopped to work... Interesting that FontAwesome still works...

Downgrading to 2.3.7 fixed

@ExpandOcean
Copy link

Same issue , with @mdi/font on windows

@sapphi-red
Copy link
Member

I was able to reproduce with vite 2.3.8.
But after updating vite to 2.9.1 and vite-plugin-svelte to 1.0.0-next.41, it did not reproduce.
Looks like it is fixed.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending triage regression The issue only appears after a new release windows only
Projects
None yet
Development

No branches or pull requests

8 participants