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

Incorrect filename in a browser popup #292

Open
2 tasks done
sou-long opened this issue Dec 30, 2023 · 2 comments
Open
2 tasks done

Incorrect filename in a browser popup #292

sou-long opened this issue Dec 30, 2023 · 2 comments

Comments

@sou-long
Copy link

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:

  • Vivaldi 6.5.3206.48 (Stable channel) (64-bit)
  • Chrome 120.0.6099.130 (Official Build) (64-bit)

Both behave the same.

Browser screenshot:
Capture1

Console screenshot:
Capture2

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@djibarian
Copy link

I'm having the same problem.

@mageekguy
Copy link

+1 here.

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

3 participants