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

fix: point source maps to TS files #578

Merged
merged 2 commits into from
Aug 16, 2024

Conversation

williazz
Copy link
Contributor

@williazz williazz commented Aug 14, 2024

Without this change, the row and column numbers will be wrong when JSErrors are applied to source maps, because they will mapped to the compiled JS files, not the original TS files.

TypeScript is supposed to output inline source maps for the JS files that they ultimately create. These TS->JS source maps are necessary so that the line number is actually correct when we debug our TS files. Webpack also needs this information so it knows what to include in the final CDN distro. Currently, we are vending the bad source maps to https://client.rum.us-east-1.amazonaws.com/1.x/cwr.js.map; however, the source map distributions are not advertised.

Documentation for TS -> JS -> Webpack source maps
https://webpack.js.org/guides/typescript/#source-maps


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@williazz williazz changed the title fix: output inline source maps with tsc fix: point source maps to TS files Aug 14, 2024
@williazz williazz marked this pull request as ready for review August 14, 2024 19:26
@ps863
Copy link
Member

ps863 commented Aug 14, 2024

question: have you tested this to verify they work now?

@williazz
Copy link
Contributor Author

question: have you tested this to verify they work now?

yes used this offline with a rum user

@williazz williazz merged commit f99498c into aws-observability:main Aug 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants