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 --watch mode break after first change (Vite v.5.X) #16694

Closed
7 tasks done
Paolino95 opened this issue May 16, 2024 · 2 comments
Closed
7 tasks done

Vite --watch mode break after first change (Vite v.5.X) #16694

Paolino95 opened this issue May 16, 2024 · 2 comments

Comments

@Paolino95
Copy link

Describe the bug

Good morning,

I report the fact that Vite build, in watch mode, builds and remains correctly active in the first build, but following the first change the build is re-run and terminated, without remaining active waiting for further changes.

The problem seems different from other old (and solved) issues, such as #12852 or #12791;

In fact, by doing some testing, I noticed that in my specific case I find the issue using TypeScript, also going through the generation of type files through https://github.com/qmhc/vite-plugin-dts.

Writing code in JS I noticed that I don't have this problem.
Now I can't figure out if this problem is related to TS or to the plugin itself, or either.

Reproduction

https://stackblitz.com/edit/vitejs-vite-czcsmo?file=src%2Fvite-env.d.ts

Steps to reproduce

Run npm install, then npm build:lib:watch.

Change something in lib/main.ts.

You will see that the build will terminate, without staying in watch mode.

System Info

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M2
    Memory: 148.11 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v18.20.2/bin/yarn
    npm: 10.5.2 - ~/.nvm/versions/node/v18.20.2/bin/npm
  Browsers:
    Brave Browser: 124.1.65.126
    Safari: 17.4.1

Used Package Manager

npm

Logs

No response

Validations

Copy link

stackblitz bot commented May 16, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sapphi-red
Copy link
Member

  • With vite-plugin-dts and rollup-plugin-sourcemaps: happens
  • With vite-plugin-dts and without rollup-plugin-sourcemaps: doesn't happen
  • Without vite-plugin-dts and withrollup-plugin-sourcemaps: watch mode broken (due to rollup-plugin-sourcemaps incompatible with the rollup 4.0.0+)
  • Without vite-plugin-dts and rollup-plugin-sourcemaps: doesn't happen

I think it's happening because rollup-plugin-sourcemaps is not compatible with rollup 4.0.0+, specifically this change.

Closing as this is not a bug in Vite.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants