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 stack trace information in dev mode #7372

Closed
7 tasks done
pragmasoft-ua opened this issue Mar 18, 2022 · 2 comments
Closed
7 tasks done

Incorrect stack trace information in dev mode #7372

pragmasoft-ua opened this issue Mar 18, 2022 · 2 comments

Comments

@pragmasoft-ua
Copy link

Describe the bug

In a newly generated vite react-ts application, stack trace information in the error caught by error boundary contains incorrect information, probably due to a wrong sourcemap file.

Reproduction application https://github.com/pragmasoft-ua/remove-vite-app

when run with npm i && npm run dev

produces a screenshot, showing stack trace in both console and error boundary page.

Console shows a valid line number of an error App.tsx:17

Whereas a stack trace in error boundary has an invalid line number

App@http://localhost:3000/src/App.tsx?t=1647602434195:50:19

The problem seems is that the latter one is a line number in a jsx processed file after jsx expansion, whereas line number should be of an original tsx file.

screenshot

Reproduction

https://github.com/pragmasoft-ua/remove-vite-app

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 19.78 GB / 31.72 GB
  Binaries:
    Node: 16.13.0 - ~\Applications\node\node.EXE
    npm: 8.1.3 - ~\Applications\node\npm.CMD
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (99.0.1150.39)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    @vitejs/plugin-react: ^1.0.7 => 1.2.0
    vite: ^2.8.0 => 2.8.6

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red
Copy link
Member

I think this is not a bug.
Also it is possible to fix by adding these lines to index.html.

    <script src="node_modules/source-map-support/browser-source-map-support.js"></script>
    <script>sourceMapSupport.install();</script>

@sapphi-red
Copy link
Member

Closing as it is not a bug.

@github-actions github-actions bot locked and limited conversation to collaborators May 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants