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

Include sourcemaps in Typescript NPM package. #32207

Open
5 tasks done
MicahZoltu opened this issue Jul 2, 2019 · 3 comments
Open
5 tasks done

Include sourcemaps in Typescript NPM package. #32207

MicahZoltu opened this issue Jul 2, 2019 · 3 comments
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript

Comments

@MicahZoltu
Copy link
Contributor

Search Terms

typescript.js.map typescript.js source map

Suggestion

I would like typescript.js.map to be included in the distributed NPM package, along with the original sources. This could be achieved either with inlineSources: true or by including the src folder in the NPM package.

Use Cases

I'm working on a compiler transformer and this has resulted in me stepping through typescript.js. Since source maps are not included, this results in me stepping through a 125,000 line JavaScript file. Not only does my editor hate me for this and sometimes locks up, the code is significantly harder to read than the original TypeScript source code.

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.
@ajafff
Copy link
Contributor

ajafff commented Jul 2, 2019

Not only does my editor hate me for this and sometimes locks up

Accidentally stepping into TypeScript code causes my IDE to pause for more than a minute. It's probably busy tokenizing and parsing that file. This is really annoying.

@RyanCavanaugh RyanCavanaugh added Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript labels Jul 3, 2019
@MicahZoltu
Copy link
Contributor Author

The situation here seems to have gotten significantly worse. VSCode will no longer open typescript.js for me at all and if I accidentally click on a frame of that during debugging the only option is to restart VSCode (thus terminating my debugging session and having to start over).

On top of that, when running code in ts-node errors that occur as part of module loading will have typescript.js in the call stack and when trying to troubleshoot module loading errors it is really easy to end up in TypeScript code, and debugging is impossible in VSCode at the moment.

@RobinTail
Copy link

RobinTail commented Oct 29, 2024

Vite/Vitest warns about this issue.
The sourcemap reference is present but broken

4:01:17 AM [vite] Failed to load source map for .../node_modules/typescript/lib/typescript.js.
Error: An error occurred while trying to read the map file at typescript.js.map
Error: ENOENT: no such file or directory, open '.../node_modules/typescript/lib/typescript.js.map'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants