Skip to content

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

elmah.io Upload Source Map

This extension uploads a source map and its minified JavaScript file to elmah.io. With the files in place, elmah.io can translate bundled and minified JavaScript stack traces back to your original source.

The task works in YAML pipelines and classic release pipelines, on Windows, Linux, and macOS agents.

Installation

Open the elmah.io Upload Source Map extension on the Azure DevOps Marketplace and click Get it free:

Install the extension

Select your organization and click Install:

Select organization

Before you start

You need:

YAML pipelines

Add the task after the step that builds your JavaScript bundle:

steps:
# other steps
- task: ElmahIoUploadSourceMap@5
  inputs:
    apiKey: 'API_KEY'
    logId: 'LOG_ID'
    path: '/bundles/sharedbundle.min.js'
    sourceMap: '$(System.DefaultWorkingDirectory)/myproject/drop/bundles/sharedbundle.map'
    minifiedJavaScript: '$(System.DefaultWorkingDirectory)/myproject/drop/bundles/sharedbundle.min.js'

You can also add the task from the assistant. Click Show assistant, search for 'elmah.io upload', and select the elmah.io Upload Source Map task:

Add the task

Store the API key as a secret pipeline variable and reference it as $(ElmahIoApiKey) instead of writing it into the YAML.

Classic release pipelines

Add the elmah.io Upload Source Map task to your release pipeline, choose task version 5.*, and fill in the fields:

Add the task

Inputs

Input Required Description
apiKey Yes An elmah.io API key with the sourcemaps_write permission.
logId Yes The ID of the log that should contain the minified JavaScript and source map.
path Yes The URL of the minified JavaScript file as it is served online. It can be absolute or relative, and elmah.io always reduces it to a relative path without protocol, domain, or query string. elmah.io uses this path to find the lines in a stack trace that need translating.
sourceMap Yes The path to the source map file. Only files with the extension .map are accepted, up to 5 MB.
minifiedJavaScript Yes The path to the minified JavaScript file. Only files with the extension .js are accepted, up to 1 MB.

Upgrading from version 4

Change ElmahIoUploadSourceMap@4 to ElmahIoUploadSourceMap@5, or pick task version 5.* in a release pipeline. Version 4 does not run on Linux agents. Version 5 runs on Windows, Linux, and macOS agents and requires agent 3.232.1 or newer. The inputs are the same.

Version 5 fails the step if elmah.io rejects the upload, for example because of a missing permission or a file with the wrong extension. The error message from elmah.io is shown in the step log.

Releases

Sponsor this project

Used by

Contributors

Languages