oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.01k stars 2.66k forks source link

Support existing source maps in stack traces #2125

Open GingerAdonis opened 1 year ago

GingerAdonis commented 1 year ago

What is the problem this feature would solve?

I have a build step which transpiles my TypeScript code to regular JavaScript with source maps. When using console.error or anything else that shows a stack trace, I expect bun to show me the stack trace from my source.

What is the feature you are proposing to solve the problem?

Either support existing source maps by default or put it behind a flag, like Node.js's --enable-source-maps flag.

What alternatives have you considered?

I'm aware that bun can transpile files which workarounds this issue. But it would be great to have support regardless.

btakita commented 7 months ago

Is there any workaround for esbuild bundles + source maps?

schettn commented 1 month ago

You can use:

import sourceMapSupport from 'source-map-support'
sourceMapSupport.install()