Sentry's Wasm integration enhances the Browser SDK, and allows it to provide more detailed debug information not only for the error itself, but also for the entire module it was executed from. It includes things like Debug IDs, Debug Files, Code IDs, Code Files and memory addresses.

Install @sentry/browser and @sentry/wasm using yarn or npm:

npm install --save @sentry/browser @sentry/wasm

and afterwards use it like this:

import * as Sentry from "@sentry/browser";
import { wasmIntegration } from "@sentry/wasm";

  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  integrations: [wasmIntegration()],

// Now, whenever any code from WebAssembly module will throw an error,
// it'll get captured and it'll contain all the necessary information.

function executeInternalWasmStuff() {
  throw new Error("whoops");

const { instance } = await WebAssembly.instantiateStreaming(
    env: {
      external_func: executeInternalWasmStuff,


If you are curious how Wasm modules look from the inside, here's a quick example written in Rust:


fn panic(_info: &core::panic::PanicInfo) -> ! {
    loop {}

extern "C" {
    pub fn external_func();

pub fn internal_func() {
    unsafe {

For more details on how to compile Rust to Wasm, see Compiling from Rust to WebAssembly MDN documentation.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").