vite-plugin-checker
vite-plugin-checker copied to clipboard
Empty `ERROR` message
Describe the bug
When typescript check option is true always getting this message
ERROR
[TypeScript] Found 0 errors. Watching for file changes.
I tried to debug it and added log with *** action to the main.js plugin source file.
And since this action treaded as an Error on line 182 we just added prefix ERROR.
Reproduction
in vite config
import checker from 'vite-plugin-checker'
...
plugins: [
checker({ typescript: true })
]
Expected behavior
Action { type: 'console', payload: '\n[TypeScript] Found 0 errors. Watching for file changes.' } should't be logged as an Error
System Info
System:
OS: macOS 13.3.1
CPU: (8) arm64 Apple M1 Pro
Memory: 1.87 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.14.0 - ~/.nvm/versions/node/v18.14.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.14.0/bin/yarn
npm: 9.3.1 - ~/.nvm/versions/node/v18.14.0/bin/npm
Browsers:
Chrome: 113.0.5672.126
Safari: 16.4
npmPackages:
vite-plugin-checker: 0.6.0 => 0.6.0
### Additional context
_No response_
### 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.
Any progress on this? Seems like the only option is to revert to 0.4.9
Actually, the change seems to have been introduced in 0.5.6
Error: no errors were found.
IM GONNA REEEE
Happening for me with nuxt 3.8.2 on a fresh install/setup
Same for me? Any workaround for this?
Still an issue
Actually, the change seems to have been introduced in 0.5.6
I figured out where the problem got introduced, but there's been no addressing of it thus far
This line looks like it might be the root of the issue. https://github.com/fi3ework/vite-plugin-checker/commit/8dd49159bddd7e3e23dfa479323322808094d8b9#diff-7c457428fc11687ac503085166d754dc2dbdaa3df69069d3027272bda149ba5cR189
I found that while trawling through the diff between v0.5.5 and 0.5.6 https://github.com/fi3ework/vite-plugin-checker/compare/vite-plugin-checker%400.5.5...vite-plugin-checker%400.5.6
@james-yeoman I'm seeing the same. Unsure why it would log if Checker.logger is empty, maybe an oversight?
So the logger comes from Vite itself. I wonder why this plugin isn't receiving the logger from Vite... https://github.com/fi3ework/vite-plugin-checker/commit/8dd49159bddd7e3e23dfa479323322808094d8b9
Ok, so vite-plugin-checker is receiving the logger from vite, I'm just a dunce...
The actual problem, is that Checker.logger is never populated, and the colouring of diagnostics and summaries are already handled by diagnosticToTerminalLog and composeCheckerSummary in vite-plugin-checker/src/logger.ts.
There's currently no way of differentiating between an error, a warning, and a checker summary.
This is beyond what I can justify spending time on during work, but hopefully my findings help someone who can spend more time on open source to fix this
As a workaround, I've got a fork that I've added a bypass to in order to avoid erroring on an empty summary. It's not the cleanest, but it allows me to adopt the ESLint Flat Config without too much problem
:/ I use yarn and so can't reference the fork since this plugin uses pnpm...
guess I'm back to using yarn patches instead...
So, no solution to this so far? lol