perspective-dev/perspective · error · Error
WebAssembly not supported.
Error message
WebAssembly not supported.
What it means
The decompress module wraps `pro_self_extracting_wasm`, a self-extracting WebAssembly module used to decompress perspective assets. It performs an environment capability check at import time and throws immediately if the global `WebAssembly` object is undefined, because the module cannot function without WASM support.
Solutions
- Run the application in a browser or Node.js version that supports WebAssembly (any modern browser; Node >= 8).
- Check for CSP headers or enterprise policies disabling WebAssembly ('unsafe-eval'/'wasm-unsafe-eval' restrictions) and allow it.
- If WASM cannot be enabled, avoid importing this module / the perspective packages that depend on it, or gate the import behind a WebAssembly support check.
- Use a polyfill-free fallback: detect support with `typeof WebAssembly === "undefined"` before loading the library and show a graceful unsupported-browser message.
Example fix
// before
import { load_wasm } from "@finos/perspective"; // throws at import on WASM-less envs
load_wasm();
// after
if (typeof WebAssembly !== "undefined") {
const { load_wasm } = await import("@finos/perspective");
await load_wasm();
} else {
console.error("This application requires WebAssembly support.");
} Defensive patterns
Strategy: fallback
Validate before calling
if (typeof WebAssembly === "undefined") {
console.warn("WebAssembly unsupported: perspective wasm modules will not load.");
} Type guard
function supportsWasm(): boolean {
return typeof WebAssembly === "object" && typeof WebAssembly.Module === "function";
} Try / catch
try {
const decompress = await import("./wasm/decompress");
} catch (e) {
if (e.message === "WebAssembly not supported.") {
showUnsupportedBrowserDialog();
} else throw e;
} Prevention
- Feature-detect WebAssembly before importing perspective packages and use dynamic imports to keep the failure recoverable.
- Set a browser-support baseline (all evergreen browsers, Node >= 8) and document it.
- Check CSP headers allow WebAssembly compilation ('wasm-unsafe-eval').
When it happens
Trigger: Importing (directly or transitively) rust/perspective-js's wasm/decompress.ts in any JavaScript environment that lacks `WebAssembly` — the check runs at module top level, so the error fires on import, not on a later call.
Common situations: Running in an old browser (IE11, pre-2017 Safari/Chrome/Firefox); Node.js < 8 without the --expose-wasm flag; embedded JS engines or SSR runtimes without WASM; CSP or enterprise policy disabling WebAssembly; webviews with WASM turned off.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
AI-assisted analysis of perspective-dev/perspective@11c8238c0c (2026-09-09).
Data as JSON: /api/errors/a8246030aea3cd48.
Report an issue: GitHub.
Appendix: source
Thrown at rust/perspective-js/src/ts/wasm/decompress.ts:17
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
// ┃ Copyright (c) 2017, the Perspective Authors. ┃
// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
// ┃ This file is part of the Perspective library, distributed under the terms ┃
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
// @ts-ignore
import { extract } from "pro_self_extracting_wasm";
if (typeof WebAssembly === "undefined") {
throw new Error("WebAssembly not supported.");
}
interface Module extends WebAssembly.Exports {
size(): number;
offset(): number;
memory: WebAssembly.Memory;
}
// Perform a silly dance to deal with the different ways webpack and esbuild
// load binary, as this may either be an `ArrayBuffer` or `URL` depending
// on whether `inline` option was specified to `perspective-esbuild-plugin`.
async function compile(
buffer: ArrayBuffer | Response | WebAssembly.Module | WebAssembly.Exports,
): Promise<Module> {
if (buffer instanceof Response) {
return (await WebAssembly.instantiateStreaming(buffer)).instance
.exports as Module;
} else if (buffer instanceof WebAssembly.Module) {View on GitHub (pinned to 11c8238c0c)