Skip to content

Instantly share code, notes, and snippets.

@bobbyg603
Created April 21, 2021 17:33
Show Gist options
  • Save bobbyg603/d6793bb8408d2b97a9e08f7a509dbb6d to your computer and use it in GitHub Desktop.
Save bobbyg603/d6793bb8408d2b97a9e08f7a509dbb6d to your computer and use it in GitHub Desktop.
Load TypeScript source maps at runtime
// @bobbyg603
// 04-21-2021
// bugsplat.com
import { StackConverter } from '@bugsplat/stack-converter';
(async () => {
try {
crash();
} catch(error) {
console.log(error.stack)
const converter = await StackConverter.createFromDirectory('.');
const result = await converter.convert(error.stack);
console.log(result.stack);
}
})();
function crash() {
throw new Error('BugSplat rocks!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment