Uploading source maps TypeScript


#1

Hi,

I’m using TypeScript in a node environment with sentry. I read the docs that you need to configure tsc to make source maps and there is some additional instructions here:

Please read Source Maps docs first to learn how to configure Sentry SDK, upload artifacts to our servers or use Webpack (if you’re willing to use ts-loader for your TypeScript compilation).

For uploading the source maps, though, my question is what should I do if I’m not using webpack, such as in an express environment? Should I use the webpack plguin anyways?

Thanks


#2

You’ll need to generate sourcemaps with whatever tool is generating the transpiled code. Its commonly something like Webpack, but any tool that transpiles should have a way to generate the sourcemaps as well (assuming its fully featured). If you’re going through multiple bundlers (e.g. typescript -> webpack) it’s likely to be trickier to map back to the original code, but they’re still often supported.

I can’t comment on the way you’re using TypeScript specifically, but maybe someone else can.


#3

Thank you. I am just using tsc on server-side, nothing else. No webpack or any other build tools.

So all I have to do is upload the folder with the source maps using the CLI like

sentry-cli releases files VERSION upload-sourcemaps /path/to/sourcemaps

And it should be good?


#4

I believe that’d be correct. You can test them via sourcemaps.io. If that reports success then as long as you upload the relevant artifacts, Sentry will also be able to handle them.