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

Sourcemap is ignored if file contains dynamic import #289

Closed
2 tasks
BenceSzalai opened this issue Aug 23, 2023 · 2 comments
Closed
2 tasks

Sourcemap is ignored if file contains dynamic import #289

BenceSzalai opened this issue Aug 23, 2023 · 2 comments
Labels
bug Something isn't working outdated pending triage

Comments

@BenceSzalai
Copy link

BenceSzalai commented Aug 23, 2023

Problem

Dependency files that:

  • include ESM dynamic imports
  • has sourcemaps associated (generated by TSC)

show up in Error stack traces:

  • with .js extension (as opposed to .ts)
  • with wrong line numbers
  • and with their real file path instead of the original path based on the sourcemap

i.e. their source maps are ignored.

Expected behavior

All dependency files that has sourcemaps associated should show up in Error stack traces with their original path, extension and line numbers.

Minimal reproduction URL

https://github.com/BenceSzalai/tsx-sm-issue

Version

v3.12.7

Node.js version

v18.17.0 / v20.5.1

Package manager

npm

Operating system

macOS

Contributions

  • I plan to open a pull request for this issue
  • I plan to make a financial contribution to this project
@BenceSzalai BenceSzalai added bug Something isn't working pending triage labels Aug 23, 2023
@BenceSzalai
Copy link
Author

Note, I've just updated the reproduction repo to compare with the equivalent non-TSX Node.js behaviour which uses sourcemaps correctly, so surprisingly it is only happening with TSX.

@BenceSzalai
Copy link
Author

BenceSzalai commented Aug 23, 2023

On the other hand I've just compared the behaviour with the ESM Loader usage, and it looks like it is caused by ESM Loader, so I'll raise it there instead.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working outdated pending triage
Projects
None yet
Development

No branches or pull requests

1 participant