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

Broken sourcemap #14109

Closed
7 tasks done
SenyaMur opened this issue Aug 15, 2023 · 3 comments · Fixed by #14232
Closed
7 tasks done

Broken sourcemap #14109

SenyaMur opened this issue Aug 15, 2023 · 3 comments · Fixed by #14232
Labels
feat: sourcemap Sourcemap support p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@SenyaMur
Copy link

Describe the bug

Vite create broken sourcemap file.
I reproduce this situation on clear vite bolerplate project use the follow command: pnpm create vite my-react-app --template react-ts
Than, I add two files with one hook:

  • hookBad.ts
  • hookGood.ts

And call both hook in App.tsx

Then, debug hookBad.ts sourcemap with incorrect line
Then, debug hookGood.ts sourcemap with correct line

The difference is import react as multiline.
image

Bad sourcemap
image

Good sourcemap
image

Reproduction

https://github.com/SenyaMur/vite-reatct-bad-hook

Steps to reproduce

clone repo https://github.com/SenyaMur/vite-reatct-bad-hook
pnpm i
pnpm dev
launch site in browser (for example: Chrome)
open DevTools and refresh site (press F5)

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (16) x64 AMD Ryzen 7 4800H with Radeon Graphics
    Memory: 4.99 GB / 15.42 GB
  Binaries:
    Node: 18.16.1 - C:\Program Files\nodejs\node.EXE
    npm: 8.3.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.6.7 - ~\AppData\Roaming\npm\pnpm.CMD
  npmPackages:
    @vitejs/plugin-react: ^4.0.4 => 4.0.4
    vite: ^4.4.9 => 4.4.9

Used Package Manager

pnpm

Logs

No response

Validations

@SenyaMur
Copy link
Author

Any news on the issue?

@sapphi-red sapphi-red added the p3-minor-bug An edge case that only affects very specific usage (priority) label Aug 29, 2023
@sapphi-red sapphi-red added the feat: sourcemap Sourcemap support label Aug 29, 2023
@SenyaMur
Copy link
Author

SenyaMur commented Sep 2, 2023

In which version this issue will be?

@bluwy
Copy link
Member

bluwy commented Sep 4, 2023

This will come in the next Vite beta release, which should be 5.0.0-beta.1

@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: sourcemap Sourcemap support p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants