How to show the source code in Sentry's stack trace?

44 Views Asked by At

I am using Sentry for collecting JavaScript errors. Also, I do not use build tools like Webpack or Vite to transpile JavaScript. Therefore, I am not outputting source maps. In this case, is there a way to show JavaScript source code in Sentry's stack trace?

Here's an example.

In this case, I'd like to show the source code of somethingWrong.js in the Sentry's stack trace.

// somethingWrong.js

function somethingWrong() {
  throw new Error("somethingWrong");
}

somethingWrong();
<!-- index.html -->

<script src="path/to/somethingWrong.js"></script>
1

There are 1 best solutions below

0
c8112002 On