egoist / esbuild-register

Transpile JSX, TypeScript and esnext features on the fly with esbuild
MIT License
989 stars 52 forks source link

Upgrading from 3.3.1 to 3.3.2 broke sourcemaps support #90

Closed pmezard closed 1 year ago

pmezard commented 1 year ago

Hello,

This is probably a misconfiguration on my side but I have spent some time testing various option combinations to no avail. I have a command like:

node --trace-warnings -r source-map-support/register -r esbuild-register -r ./src/local/env.ts ./bin/something.ts

When throwing an error with 3.3.1, the stack trace is correct. When throwing an error with 3.3.2 (or 3.4.2), the trace line numbers are incorrect. This is running with node 18.15.0

I have tried removing source-map-support/register or adding --enable-source-maps, without success.

Before trying to make a minimal test case, would you have anything coming to mind about this?

Thanks,

tim-rohrer commented 1 year ago

Did you get this resolved? I've also run into the problem of incorrect line numbers in the stack traces.

esbuild-register version >3.4.2 and node 18.17 and node 16.

I also tried setting sourceMap to True in the tsconfig.json

pmezard commented 1 year ago

I finally took the time to bisect the codebase to build a reproducer. I had 2 related issues:

Once those removed, line numbers are good again. For the record, I am using:

dev  esbuild                                      0.17.18       
dev  esbuild-register                             3.4.2   

And will try to upgrade esbuild soon. Another adventure I guess.

Closing the issue.