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

Sourcemaps not being parsed properly? #99

Closed
kennand opened this issue Mar 11, 2021 · 12 comments
Closed

Sourcemaps not being parsed properly? #99

kennand opened this issue Mar 11, 2021 · 12 comments
Labels
wontfix This will not be worked on

Comments

@kennand
Copy link

kennand commented Mar 11, 2021

Hey! Not sure if I'm doing something wrong here, but I see the sourcemap next to my files and it's not being parsed by my log viewer... Anyone else using source maps?

#91

@floydspace
Copy link
Owner

hey @kennandavison could you try using inline sourcemaps to reduce the number of the possible reasons of the issue

custom:
  esbuild:
    sourcemap: inline

@kennand
Copy link
Author

kennand commented Mar 11, 2021

Tried that and still having troubles getting sourcemap associated.

More context: using seed.run (which has a Sentry-like stack trace viewer). Was using serverless-bundle which worked, but not working here. Trying to also see if it's on their end as well!

@floydspace
Copy link
Owner

Hey @kennandavison, I'm trying to test the issue. Have prepared the stack for seed.run, it's perfectly deployed, but not sure how to reproduce your issue, could you please guide me where is that Sentry-like stack trace viewer. thank you

@kennand
Copy link
Author

kennand commented Mar 14, 2021

https://seed.run/docs/issues-and-alerts.html#enabling-issues should get it up and running

@floydspace
Copy link
Owner

@kennandavison I bet you're expecting stack trace like this:
image
with exact pointer where is the issue?

@kennand
Copy link
Author

kennand commented Mar 14, 2021

Yep, the line number/pointer is off when using esbuild, but correct when using serverless bundle. Are you seeing the same thing?

@floydspace
Copy link
Owner

@kennandavison yes I could reproduce it. so with serverless-esbuild plugin I cannot see the pointer to the source code line.
But I cannot help here much, because it's esbuild feature itself. Esbuild just creates source maps a little bit differently than webpack. I would raise the issue in their repository. My assumption is you probably have to push source code to lambda along with bundled one to have it worked.

@floydspace
Copy link
Owner

@kennandavison no the assumption does not work either, so it's definitely esbuild issue

@floydspace floydspace added the wontfix This will not be worked on label Mar 14, 2021
@kennand
Copy link
Author

kennand commented Mar 14, 2021

Got it - thanks for checking this out!

@floydspace
Copy link
Owner

@kennandavison let me know if you gonna raise the issue in esbuild repo.
Closing this issue.

@kennand
Copy link
Author

kennand commented Mar 26, 2021

Hey - turns out you just need to add an env var! Serverless-bundle automatically does this while serverless-esbuild doesn't. https://serverless.pub/aws-lambda-node-sourcemaps/#enabling-the-native-source-map-support-for-node-12

Hope this helps someone else using sourcemaps :)

@pierreh
Copy link

pierreh commented Aug 8, 2023

also make sure to use sourcemaps: true instead of sourcemaps: external this will set sourceMappingURL correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants