Skip to content

[Feature Request]: Support for source maps without release_idΒ #649

@TrevorBurnham

Description

@TrevorBurnham

Please provide your feature request

I was excited to see Cloudwatch RUM get support for unminification with source maps: #231 However, looking at the user guide for the feature, I realized that it would be challenging to set up for my application, which has no existing notion of a release_id.

For context, I'm using Next.js, which follows the popular convention across many JavaScript frameworks of:

  1. Using hashes to generate a unique name for each .js chunk (based on its contents), and
  2. Emitting .js and .js.map files as siblings (if enabled).

I upload all of those assets to S3, so that e.g. a request for /_next/static/chunks/f8ca1dff67f056a5.js would go to /.next/static/chunks/f8ca1dff67f056a5.js in my bucket, and its corresponding source map would be located at /.next/static/chunks/f8ca1dff67f056a5.js.map in my bucket.

What would really be convenient would be to have a way to tell RUM how to perform that mapping from .js filename to .js.map filename. I'd suggest configuration parameters along the lines of routePrefix and bucketPrefix: In my case, I'd specify routePrefix: "/_next/static/chunks" and bucketPrefix: "/.next/static/chunks". Then RUM could look up the source map for any requested .js file by subtracting the routePrefix, adding the bucketPrefix, and changing the file extension from .js to .js.map.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions