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] The Vite server doesn't restart on vite.config.js change #12747

Closed
vursen opened this issue Jan 17, 2022 · 2 comments
Closed

[Vite] The Vite server doesn't restart on vite.config.js change #12747

vursen opened this issue Jan 17, 2022 · 2 comments
Labels
bug Impact: Low Severity: Minor vite Tickets related to vite support

Comments

@vursen
Copy link
Contributor

vursen commented Jan 17, 2022

Description of the bug

In a basic Vite example, you can see that Vite automatically restarts the server once you change the Vite config file that is vite.config.ts by default.

However, for some reason, nothing seems to restart when changing vite.config.ts in a Flow / Fusion project.

Minimal reproducible example

The problem can be seen in any Flow / Fusion project created with https://start.vaadin.com/welcome.

Expected behavior

The Vite server automatically restarts when vite.config.ts changes.

Actual behavior

The Vite server doesn't restart when vite.config.ts changes.

@vursen vursen added the vite Tickets related to vite support label Jan 17, 2022
@vursen vursen changed the title [Vite] The Vite server doesn't restart when changing vite.config.js [Vite] The Vite server doesn't restart on vite.config.js change Jan 17, 2022
@xania
Copy link

xania commented Dec 17, 2022

My workaround for restarting vite on file change:

  1. create vite.js
import { createServer } from "vite";
import config from "./vite.config.js";

(async () => {
  const server = await createServer({
    // any valid user config options, plus `mode` and `configFile`
    ...config,
    configFile: false,
  });
  await server.listen();

  server.printUrls();
})();
  1. start using nodemon

npx nodemon vite.js

@Artur-
Copy link
Member

Artur- commented Mar 22, 2023

This was fixed in Vite 4.2.0: vitejs/vite#12349

@Artur- Artur- closed this as completed Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Impact: Low Severity: Minor vite Tickets related to vite support
Projects
None yet
Development

No branches or pull requests

5 participants