preact-ts sourcemap wrong line number
See original GitHub issueDescribe the bug
Using preact-ts template in dev mode produces wrong line numbers in source maps.
Reproduction
- npm init @vitejs/app vite-preact-ts --template preact-ts
- cd vite-preact-ts
- npm install
- In app.tsx add
console.log('line 4');
on line 4 - npm run dev
- Open console in Chrome, the log will say
line 4 - app.tsx:3
The line numbers are not just off by 1, with real components, they can be off by 20 lines or more.
System Info
Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:
System:
OS: Windows 10 10.0.18363
CPU: (12) x64 Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
Memory: 15.94 GB / 31.59 GB
Binaries:
Node: 12.20.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.10 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.18362.449.0)
Internet Explorer: 11.0.18362.1
npmPackages:
vite: ^2.1.5 => 2.1.5
Used package manager: npm
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Incorrect line numbers - sourcemaps, Webpack 2 Typescript
ts in Chrome Developer Tools so I am wondering if there is a way to change my Webpack sourcemap settings to see the...
Read more >source-map-support - npm
It uses the source-map module to replace the paths and line numbers of source-mapped files with their original paths and line numbers.
Read more >Incorrect Line Numbers - Sourcemaps, Webpack 2 ... - ADocLib
This module provides source map support for stack traces in node via the V8 stack trace API. It uses the sourcemap module to...
Read more >Easy Debugging In React With WebPack Source Maps - Medium
devtool : 'inline-source-map'. Now when we encounter an error in the console, It'll point us to the correct file and line. Cool huh??...
Read more >Source Maps - Rollbar Docs
Stack traces will contain the original source filename, line number, method name, and code coordinates; Error grouping will be more resilient to code...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Quick fix:
This will install latest dependencies, including
@prefresh/vite
with 2.2.3 version which contains bugfix mentioned by @TobiasMelenLooks like it was a upstream issue and it was fixed. I will close this issue because I confirmed it is now working.