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

vinxi run, incorrect stack trace line number #452

Open
jcalfee opened this issue Jan 18, 2025 · 0 comments
Open

vinxi run, incorrect stack trace line number #452

jcalfee opened this issue Jan 18, 2025 · 0 comments

Comments

@jcalfee
Copy link

jcalfee commented Jan 18, 2025

mkdir vinxi-sourcemap
vinxi-sourcemap
pnpm init
pnpm add vinxi
+ vinxi 0.5.1
cat<<-DONE>throw.js
console.log('running...')
throw new Error('Error thrown from line 2')
DONE

vinxi run -- throw.js 
running...

 ERROR  Error thrown from line 2                                                                                                                                                                                                                                                                                                        7:30:45 AM

  at eval (throw.js:4:7)
  at ESModulesRunner.runViteModule (/home/james/.local/share/pnpm/global/5/.pnpm/vite@5.4.1_@types+node@22.4.1_terser@5.31.6/node_modules/vite/dist/node/runtime.js:1045:6)
  at ViteRuntime.directRequest (/home/james/.local/share/pnpm/global/5/.pnpm/vite@5.4.1_@types+node@22.4.1_terser@5.31.6/node_modules/vite/dist/node/runtime.js:1018:78)
  at ViteRuntime.cachedRequest (/home/james/.local/share/pnpm/global/5/.pnpm/vite@5.4.1_@types+node@22.4.1_terser@5.31.6/node_modules/vite/dist/node/runtime.js:937:28)
  at ViteRuntime.executeEntrypoint (/home/james/.local/share/pnpm/global/5/.pnpm/vite@5.4.1_@types+node@22.4.1_terser@5.31.6/node_modules/vite/dist/node/runtime.js:873:23)
  at Object.run (/home/james/.local/share/pnpm/global/5/.pnpm/vinxi@0.4.3_@types+node@22.4.1_ioredis@5.4.1_terser@5.31.6/node_modules/vinxi/bin/cli.mjs:460:25)
  at runCommand (/home/james/.local/share/pnpm/global/5/.pnpm/citty@0.1.6/node_modules/citty/dist/index.mjs:316:16)
  at runCommand (/home/james/.local/share/pnpm/global/5/.pnpm/citty@0.1.6/node_modules/citty/dist/index.mjs:307:11)
  at runMain (/home/james/.local/share/pnpm/global/5/.pnpm/citty@0.1.6/node_modules/citty/dist/index.mjs:445:7) 

Stack trace reports the error was thrown from line 4 character 7. Shouldn't this state line 2 character 1?

Other attempts with same results:

NODE_OPTIONS=--enable-source-maps vinxi run -- throw.js
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

1 participant