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

Empty ERROR message #238

Open
denchiklut opened this issue May 24, 2023 · 13 comments
Open

Empty ERROR message #238

denchiklut opened this issue May 24, 2023 · 13 comments

Comments

@denchiklut
Copy link

denchiklut commented May 24, 2023

Describe the bug

When typescript check option is true always getting this message
Screenshot 2023-05-24 at 2 00 30 PM

 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.
Screenshot 2023-05-24 at 1 48 14 PM

And since this action treaded as an Error on line 182 we just added prefix ERROR.

Screenshot 2023-05-24 at 1 49 26 PM

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.
@jonocairns
Copy link

Any progress on this? Seems like the only option is to revert to 0.4.9

@james-yeoman
Copy link

james-yeoman commented Aug 10, 2023

Actually, the change seems to have been introduced in 0.5.6

@ferm10n
Copy link

ferm10n commented Oct 3, 2023

Error: no errors were found.
image

IM GONNA REEEE

@oniice
Copy link

oniice commented Dec 18, 2023

Happening for me with nuxt 3.8.2 on a fresh install/setup

@onkar-rentomojo
Copy link

Same for me? Any workaround for this?

@ibockowsky
Copy link

Still an issue
image

@james-yeoman
Copy link

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

@james-yeoman
Copy link

This line looks like it might be the root of the issue. 8dd4915#diff-7c457428fc11687ac503085166d754dc2dbdaa3df69069d3027272bda149ba5cR189

I found that while trawling through the diff between v0.5.5 and 0.5.6 vite-plugin-checker@0.5.5...vite-plugin-checker@0.5.6

@kristremblay
Copy link

@james-yeoman I'm seeing the same. Unsure why it would log if Checker.logger is empty, maybe an oversight?

@james-yeoman
Copy link

So the logger comes from Vite itself. I wonder why this plugin isn't receiving the logger from Vite... 8dd4915

james-yeoman added a commit to james-yeoman/vite-plugin-checker that referenced this issue Feb 29, 2024
Fixes fi3ework#238

It appears `config.logger` can be null or undefined,
despite the typescript types for Vite specifying
logger as required
@james-yeoman
Copy link

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

james-yeoman added a commit to james-yeoman/vite-plugin-checker that referenced this issue Mar 1, 2024
@james-yeoman
Copy link

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

@james-yeoman
Copy link

:/ I use yarn and so can't reference the fork since this plugin uses pnpm...

guess I'm back to using yarn patches instead...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants