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

Linaria doesn't work with Vite 4.3 in dev mode #1236

Closed
nstepien opened this issue Apr 20, 2023 · 6 comments
Closed

Linaria doesn't work with Vite 4.3 in dev mode #1236

nstepien opened this issue Apr 20, 2023 · 6 comments
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked bundler: webpack 📦 Issue is related to webpack bundler needs: complete repro 🖥️ Issue need to have complete repro provided

Comments

@nstepien
Copy link
Contributor

Environment

  • Linaria version: @linaria/vite@4.2.9
  • Bundler (+ version): vite@4.3.1
  • Node.js version: 20.0.0
  • OS: Win11

Description

Linaria stopped working after Vite 4.3 in dev mode (the vite command).
It works fine with vite build + vite preview.
vite@~4.2.0 works fine too in either dev or prod builds.
Not sure if this is an issue with linaria or with vite.

This is the error I get:

  VITE v4.3.1  ready in 476 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h to show help
Failed to load url /main_1nkbhq3.css (resolved id: D:/repos/vite-bug/main_1nkbhq3.css) in D:/repos/vite-bug/main.js. Does the file exist?

Reproducible Demo

https://github.com/nstepien/vite-bug/tree/vite43
Clone the repo, checkout the vite43 branch, npm ci
npm run dev -> white page
npm run build + npm run preview -> green page

@nstepien nstepien added bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided needs: triage 🏷 Issue needs to be checked and prioritized labels Apr 20, 2023
@github-actions github-actions bot added bundler: webpack 📦 Issue is related to webpack bundler and removed needs: triage 🏷 Issue needs to be checked and prioritized labels Apr 20, 2023
@Anber
Copy link
Collaborator

Anber commented Apr 24, 2023

Looks like I need Windows for experiments…

@houlang
Copy link

houlang commented Apr 25, 2023

I have had the same problem and have now switched to vite@~4.2.0 but not vite@^4.2.0

@nstepien nstepien changed the title Linaria doesn't work with Vite 4.3 in dev more Linaria doesn't work with Vite 4.3 in dev mode Apr 26, 2023
@nstepien
Copy link
Contributor Author

@Anber let me know if you want me to try something on my windows machine.

@sorenhoyer
Copy link

I have the same problem. Reverting to 4.2 for now.

@nstepien
Copy link
Contributor Author

nstepien commented May 5, 2023

I figured out we can get vite+linaria working by replacing @linaria/vite with @linaria/rollup, works with both Vite or Vitest as far as I can tell.

I wonder what we're missing out on by not using @linaria/vite.

@nstepien
Copy link
Contributor Author

Looks like this is fixed in the latest version of @linaria/vite 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked bundler: webpack 📦 Issue is related to webpack bundler needs: complete repro 🖥️ Issue need to have complete repro provided
Projects
None yet
Development

No branches or pull requests

4 participants