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

Mapping files are bundled with packages on npm #9481

Closed
ImRodry opened this issue Apr 30, 2023 · 10 comments
Closed

Mapping files are bundled with packages on npm #9481

ImRodry opened this issue Apr 30, 2023 · 10 comments
Labels

Comments

@ImRodry
Copy link
Contributor

ImRodry commented Apr 30, 2023

Which package is this bug report for?

builders

Issue description

Selected builders cuz it's the one I noticed the issue in but it applies to all TS packages. Basically the .js.map files are being sent to npm, which then breaks error stacks for people with source map support enabled since you can't Ctrl + click the file paths as they lead to the .ts files which are not in your directory. I believe these files shouldn't be included so that we can click the paths in errors and go straight to the code, even if it's the compiled versions.

Code sample

No response

Versions

Happens on the latest version of every package I believe

Issue priority

Low (slightly annoying)

Which partials do you have configured?

Not applicable

Which gateway intents are you subscribing to?

Not applicable

I have tested this issue on a development release

No response

@iCrawl
Copy link
Member

iCrawl commented May 1, 2023

This seems intended. What good would a stacktrace to a transpiled (but not minified) file do?

When we consider bug reports and help requests, it is more beneficial to have it point to the actual source of the TS file (even if not shipped) which one can easily look up on GitHub afterwards.

The alternative would be shipping the current source files.
Not shipping .js.map files is just running node without --enable-source-maps

@ImRodry
Copy link
Contributor Author

ImRodry commented May 1, 2023

My use case was to look directly in the code and add a console log in the library function for debugging purposes. I understand your side though, so I’m not sure which situation would be more common, I just thought it wasn’t really standard to ship .map files.

@iCrawl
Copy link
Member

iCrawl commented May 1, 2023

Have you tried using a debugger?

https://code.visualstudio.com/docs/editor/debugging

@ImRodry
Copy link
Contributor Author

ImRodry commented May 1, 2023

Not really used to using that tool but I might try it in the future. I usually just run the app normally since I’ve never really seen any benefit in using that

@DetachHead
Copy link

the source maps should stay in the npm package, but the source code should be included too. that way, ctrl+click would work and show the source code instead of the compiled js

@Jiralite Jiralite closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2023
@ImRodry
Copy link
Contributor Author

ImRodry commented Jul 9, 2023

I don’t understand why you don’t want to fix this tbh, it would be quite easy and would improve the developer experience with your packages but alright

@didinele
Copy link
Member

didinele commented Jul 9, 2023

I don’t understand why you don’t want to fix this tbh, it would be quite easy and would improve the developer experience with your packages but alright

And in turn massively hurt our experience as library maintainers? Since now whenever someone reported a bug that involves an error we'd have to figure out what it points to ourselves. Publishing source maps is correct in a library.

@vladfrangu
Copy link
Member

I feel like there's two separate requests: remove source maps from the published modules or include the src code in the published module.

The former is definitely not happening, no matter how you dice it. The latter I'm 🦐 about - its extra wasted space but it doesn't hurt

@ImRodry
Copy link
Contributor Author

ImRodry commented Jul 9, 2023

There’s only one request here which is to remove the source maps from npm as stated in the issue, the option to include the source code was mentioned by someone else and is not my request as I agree that would just add unnecessary extra space.
When there’s a bug with the library you should always reproduce it yourself in order to fix it, so the stack trace with the source code isn’t very useful + without the source maps you can still go to the compiled function, see its name and everything that would help you get to the source. I’d much rather sacrifice that small thing in favor of having readable and clickable stack traces, but that’s me

@DetachHead
Copy link

i've re-raised this issue with my proposed solution of including the source code along with the source maps #9693

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants