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

Continuous output of "[TypeScript] Found 0 errors. Watching for file changes." when no changes are made #221

Closed
Artur- opened this issue Feb 15, 2023 · 5 comments
Labels
upstream Bug in a dependency

Comments

@Artur-
Copy link

Artur- commented Feb 15, 2023

Describe the bug

Sometimes, not always, after starting Vite I see a lot of

[TypeScript] Found 0 errors. Watching for file changes.
[TypeScript] Found 0 errors. Watching for file changes.
[TypeScript] Found 0 errors. Watching for file changes.
[TypeScript] Found 0 errors. Watching for file changes.
[TypeScript] Found 0 errors. Watching for file changes.

rows in the output. They seem to pop up there every 2-3s when no changes are made to the project files and there is not even a browser open to the application.

If you have any good way of debugging what triggers this logging, I might be able to shed some more light on the root cause

Reproduction

There does not seem to be any way to reproduce the problem as it sometimes happens on startup and sometimes it does not happen at all. All with the same project.

Expected behavior

A check is triggered by a change and only then a row is output

System Info

System:
    OS: macOS 13.2.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 3.36 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Brave Browser: 107.1.45.123
    Chrome: 110.0.5481.100
    Chrome Canary: 112.0.5597.1
    Firefox: 108.0.1
    Firefox Developer Edition: 105.0
    Safari: 16.3
  npmPackages:
    vite-plugin-checker: 0.5.5 => 0.5.5 


### Additional context

This has started happening "recently" but that can be in the last 6 months or so and I cannot say which version it would relate to

### Validations

- [X] Read the [docs](https://github.com/fi3ework/vite-plugin-checker#readme).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@Artur-
Copy link
Author

Artur- commented Mar 9, 2023

It seems like this does not occur when using Vite 3.1.0 + vite-plugin-checker 0.4.9 but it does occur with Vite 3.2.5 + vite-plugin-checker 0.5.4 and newer

Ideas how to debug the cause? Where is the file watcher set / events handled?

@vaithu
Copy link

vaithu commented Mar 9, 2023

Shall I send you my project which has this issue?

@Artur-
Copy link
Author

Artur- commented Mar 23, 2023

When using "extendedDiagnostics": true, you can see output like

Elapsed:: 0.009900003671646118ms FileWatcher:: Triggered with projectfolder\node_modules@types\node\package.json 1:: WatchInfo: projectfolder\node_modules@types\node\package.json 2000 undefined File location affecting resolution

It also shows up for some other package.json files. Why are these even watched when tsconfig.json contains

  "include": [
    "frontend/**/*",
    "types.d.ts"
  ],

@Artur-
Copy link
Author

Artur- commented Apr 3, 2023

A potentially identified cause for this is that it was introduced by upgrading to TypeScript 4.9 which uses native events for the file system watchers by default. I have heard from several people that changing the settings back to use polling resolves the problem.

@Artur-
Copy link
Author

Artur- commented Apr 4, 2023

Hopefully this was the problem in TypeScript that was resolved in microsoft/TypeScript#51626

@fi3ework fi3ework added the upstream Bug in a dependency label Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Bug in a dependency
Projects
None yet
Development

No branches or pull requests

3 participants