denoland/deno · error · Error

No such module: ${name}

Error message

No such module: ${name}

What it means

getBinding(name) backs Deno's internalBinding() polyfill: a fixed table (modules) in ext/node/polyfills/internal_binding/mod.ts maps Node internal binding names to Deno implementations. A name not present in the table throws a plain Error ('No such module: <name>') with no error code — meaning that Node internal binding is not (yet) implemented.

Source

Thrown at ext/node/polyfills/internal_binding/mod.ts:151

  "tls_wrap": {},
  "trace_events": {},
  "tty_wrap": ttyWrap,
  types,
  "udp_wrap": udpWrap,
  url: {},
  util,
  uv,
  v8: {},
  worker: {},
  zlib: {},
};

export type BindingName = keyof typeof modules;

export function getBinding(name: BindingName) {
  const mod = modules[name];
  if (!mod) {
    throw new Error(`No such module: ${name}`);
  }
  return mod;
}

View on GitHub (pinned to 9ad36f7a2c)

Solutions

  1. Upgrade Deno — the compat table grows every release and the failing binding may be implemented
  2. Avoid the code path or API that needs the binding (often behind a flag or optional feature of the package)
  3. Search denoland/deno issues for the binding name and file one if missing, with the failing package

Example fix

// before
const binding = internalBinding('node_sqlite'); // No such module: node_sqlite

// after
let binding;
try {
  binding = internalBinding('node_sqlite');
} catch {
  binding = undefined; // fall back to node:sqlite public API or WASM sqlite
}
Defensive patterns

Strategy: try-catch

Validate before calling

import { getBinding } from 'node:internal_binding/mod.ts'; // internal only
const implemented = (() => { try { getBinding(name); return true; } catch { return false; } })();

Try / catch

try {
  binding = internalBinding(name);
} catch (e: any) {
  if (/^No such module: /.test(e?.message ?? '')) {
    binding = undefined; // fall back to public API path
  } else throw e;
}

Prevention

When it happens

Trigger: An npm dependency calling internalBinding('<unimplemented-name>'), e.g. bindings added in newer Node releases (sqlite, quic, sea) or version-specific internals; typos in manual internalBinding calls; native addons reaching into internals absent from Deno's compat layer.

Common situations: Packages written against a newer Node version than Deno's node-compat supports; CLI tools that probe optional internal bindings; a Deno upgrade changing which modules are registered.

Related errors


AI-assisted analysis of denoland/deno@9ad36f7a2c (2026-08-20). Data as JSON: /api/errors/b76b684487097c50. Report an issue: GitHub.