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

Build in watch mode does not regenerate correctly the types #383

Closed
Lukinoh opened this issue Sep 9, 2024 · 0 comments
Closed

Build in watch mode does not regenerate correctly the types #383

Lukinoh opened this issue Sep 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Lukinoh
Copy link

Lukinoh commented Sep 9, 2024

Describe the bug

When I run vite in build --watch mode, it does not regenerate correctly the types.
See the reproduction steps for more details.

Reproduction

https://github.com/Lukinoh/repro-build-watch-bug-vite-plugin-dts

Steps to reproduce

  • git clone [email protected]:Lukinoh/repro-build-watch-bug-vite-plugin-dts.git

  • cd repro-build-watch-vite-plugin-dts

  • npm install

  • npm run build:watch

  • Open the files

    • dist/identifier/identifier-list.d.ts
    • dist/identifier/identifier-manager.d.ts
      In both files you have a reference to the identifier-1
  • Add a new identifier new Identifier("identifier-2") in the src/identifier/identifier-list.ts
    You can see that only dist/identifier/identifier-list.d.ts file was updated correctly.

To have both files updated correctly, you can either restart the npm run build:watch or add space in the src/identifier/identifier-manager.ts.

The bug is also present when rollupTypes is set to true.
In that case, the my-lib.d.ts is not updated at all.

System Info

System:
  OS: Linux 5.15 Pengwin 12 (bookworm)
  CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Memory: 2.74 GB / 11.68 GB
  Container: Yes
  Shell: 5.2.15 - /bin/bash
Binaries:
  Node: 20.14.0 - ~/.local/state/fnm_multishells/21335_1725864564237/bin/node
  Yarn: 1.22.19 - ~/.local/state/fnm_multishells/21335_1725864564237/bin/yarn
  npm: 10.7.0 - ~/.local/state/fnm_multishells/21335_1725864564237/bin/npm
  pnpm: 9.7.0 - ~/.local/state/fnm_multishells/21335_1725864564237/bin/pnpm
  bun: 1.0.1 - ~/.bun/bin/bun
npmPackages:
  @vitejs/plugin-vue: ^5.1.2 => 5.1.3
  vite: ^5.4.1 => 5.4.3
  vite-plugin-dts: ^4.2.1 => 4.2.1


### Validations

- [X] Read the [FAQ](https://github.com/qmhc/vite-plugin-dts#faq).
- [X] Check that there isn't [already an issue](https://github.com/qmhc/vite-plugin-dts/issues) that reports the same bug to avoid creating a duplicate.
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
@qmhc qmhc added pending Need further confirmation bug Something isn't working and removed pending Need further confirmation labels Sep 9, 2024
@qmhc qmhc closed this as completed in a7e1c0c Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants