fi3ework / vite-plugin-checker

💬 Vite plugin that provide checks of TypeScript, ESLint, vue-tsc, Stylelint and more.
https://vite-plugin-checker.netlify.app
MIT License
1k stars 87 forks source link

Incorrect filename in a browser popup #292

Open sou-long opened 10 months ago

sou-long commented 10 months ago

Describe the bug

If you create and save an error in one file, then create and save an error in another file, the in-browser popup shows an incorrect filename for the second file. Console shows the correct filename.

Reproduction

./vite.config.ts

import {defineConfig} from 'vite'
import checker from 'vite-plugin-checker'

export default defineConfig({
    plugins: [
        checker({
            typescript: true,
        }),
    ],
})

./index.html

<script src='src/script.ts' type='module'></script>

./src/script.ts

import './other.js'
const foo = 0

./src/other.ts

export const bar = 0
  1. Start vite (vite)
  2. Open the URL it suggests
  3. See empty page
  4. Make the first error in ./src/script.ts, e.g. const fo o = 0, save.
  5. Make the second error in ./src/other.ts, e.g. export const ba r = 0, save.
  6. Go to the browser, click away the modal that popped up
  7. What's left looks like "Browser screenshot" below
  8. The filename and line info above export const ba r = 0 is incorrect
  9. Filenames in console are correct, see "Console screenshot" below

If you refresh the page, the issue goes away.

Expected behavior

All filenames in the browser must equal to the ones in the console.

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
    Memory: 55.67 GB / 63.92 GB
  Binaries:
    Node: 18.18.2 - C:\Node\node.EXE
    Yarn: 1.22.21 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.8.1 - C:\Node\npm.CMD
  Browsers:
    Edge: Chromium (120.0.2210.91)
    Internet Explorer: 11.0.19041.3636
  npmPackages:
    vite-plugin-checker: ^0.6.2 => 0.6.2

Additional context

My browsers where I actually tested this were:

Both behave the same.

Browser screenshot: Capture1

Console screenshot: Capture2

Validations

djibarian commented 9 months ago

I'm having the same problem.

mageekguy commented 7 months ago

+1 here.

WebBurnout commented 11 hours ago

I know these repeated +1 are not that helpful but I have to add that this is very annoying and I run into it daily and have to switch tabs to see what the real file name is or open a new terminal and run the check again.

Would a pull request be welcome? Any clues as to why this is happening? Thanks so much for the awesome plugin! It is really helpful and works great for me besides this problem.