published fresh until

NotCapable / Buffer is not defined: Deno compile or Deploy fix?

Summary As of October 2026, Deno compile and Deploy failures need different repairs: rebuild executable permissions, resolve npm imports explicitly, import Node globals, or refresh a reviewed lockfile. Deploy runs with allow-all, so local permission flags are not a universal deployment fix (checked 2026-10-20).

Not for ordinary script permission flags, see deno-permission-flags-agent-run-denied-allow-net-read; runtime selection, see node-bun-or-deno-for-a-production-backend-2026

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

An agent gets a script running locally, but the compiled executable or deployment fails. These four documented error families are useful in 2026; no source establishes a frequency ranking. Ordinary script flag selection belongs in the permission neighbour.

Versions and environment, checked 2026-11-24

SurfaceOfficial source fetched nowConsequence
CLIAs of November 2026, v2.9.8 release, notes dated 2026-10-21Reference release; record the actual build host with deno --version
DeployRuntime reference states Deno 2.5.0, standard Linux runtime, allow-all, no custom runtime flagsCLI and managed runtime versions need not match
CompileCompile reference embeds runtime permissions at build timeRebuild the executable to change grants

The Deploy version is the fetched documentation's claim, not an inspected live instance. Prices and licences were not surveyed because they do not determine these repairs.

When to pick which repair

FailureStart with
Subprocess refused or executable loses local grantsChild environment and compile-time permissions
Bare package or alias unresolvedRegistry specifier versus project import map
Node global missingExplicit node: import
Frozen install failsReviewed lock update

1. NotCapable at a subprocess or compiled boundary

Exact historical message is NotCapable: Requires --allow-all permissions to spawn subprocess with LD_LIBRARY_PATH environment variable. In justinmchase's report, maintainer dsherret explains that loader variables can inject code into a permitted child; a correction to the misleading diagnostic was linked. Clear unnecessary loader variables in the child's Deno.Command environment, for example env: { LD_LIBRARY_PATH: "", LD_PRELOAD: "", DYLD_FALLBACK_LIBRARY_PATH: "" }, after checking its native library requirements.

For an executable missing the grants used by deno run, rebuild with actual required scopes. An illustrative command is deno compile --allow-read=./data --allow-net=api.example.com --allow-run=git --output app main.ts, followed by ./app in a disposable fixture. Replace these sample scopes with your app's needs. This applies the compile docs; it is not a reproduced fix for every subprocess failure.

Do not replace all grants with -A, routinely grant unrestricted subprocess execution, or pass Deno flags to the generated program expecting to widen its sandbox. On Deploy, identify whether the failure occurs during build or in a subprocess: its documented runtime already uses allow-all. Report and maintainer answer, plus compile/runtime references above; checked 2026-10-20.

2. Bare npm or workspace import cannot resolve

Exact diagnostic excerpt is Relative import path "@github-issue-example/a/index.ts" not prefixed with / or ./ or ../ and not in import map. The source appends its own referring file location. In michael-aldridge-pozlo's reproduction a wildcard workspace export did not resolve; explicitly exporting the subpath worked.

For a registry package, use an npm: import or declare its dependency, for example deno add npm:chalk, then deno check main.ts. A direct import can use import chalk from "npm:chalk". In package.json projects run deno install before checking/building. For the reported workspace case, explicitly map the export ./index.ts to ./src/index.ts in that workspace's exports object, then run deno check index.ts. Choose the branch that matches the failing import.

Do not turn a local workspace into an npm dependency unless it is actually published, or add network permissions to fix an alias. Workspace reproduction and workaround; official import guidance; checked 2026-10-20. No current fixed release for the wildcard case was verified.

3. Buffer is not defined

Exact message is Buffer is not defined, reported by Indyandie during an Astro build. Deno's compatibility docs say Buffer is not global in your own code. Add import { Buffer } from "node:buffer"; to the module using it, then run deno check main.ts and the existing build task, such as deno task build if defined. Built-ins use node:; registry packages use npm:.

Do not assume an entrypoint import changes another module's lexical scope or install an arbitrary shim. If a dependency owns the reference, reduce the reproduction and check its runtime support. Build failure report verifies demand, not a universal dependency fix; official compatibility guidance; checked 2026-10-20.

4. The lockfile is out of date

Exact message is error: The lockfile is out of date. Hixie's report shows dependency edits dropping type-only dependencies. Its analysis was the reporter's claim; issue #36139 was closed on July 20, 2026 by merged PR #36140. The official supply-chain guide also documents frozen locks refusing new graph entries.

For an intentional dependency change run deno install --frozen=false --entrypoint main.ts, inspect git diff -- deno.lock deno.json, then verify deno install --frozen --entrypoint main.ts. Keep runtime, configuration and entrypoint aligned with CI. Materialize package.json dependencies before compiling. If no change was intended, restore the reviewed lock and investigate the graph change instead.

Do not disable freezing permanently, delete the lock first, or treat integrity mismatch as ordinary drift. Hixie's report; official repair procedure; checked 2026-10-20.

Community evidence

The linked justinmchase discussion includes a maintainer explanation; michael-aldridge-pozlo supplies a minimal reproduction and workaround; Indyandie supplies a real build failure. Hixie's July 2026 lockfile report says it was agent-written, human-reviewed and locally checked by its author. These establish demand, not prevalence or our own verification.

A prompt to give your agent

Read the linked official source and matching issue before proposing a fix; do not guess flags or fixed versions. Capture exact stderr, deno --version, entrypoint, config and whether this is CLI, compile, Deploy build or Deploy runtime. Match one family, propose the smallest branch diff, review locks, and test the same boundary in a disposable fixture. Do not deploy or widen all permissions.

Mistakes to check

  • Confusing executable grants with managed Deploy permissions.
  • Treating import or Buffer failures as network permission errors.
  • Regenerating locks with a different runtime or entrypoint without review.

Limits

No application, compile, CI or Deploy execution was performed. Historical strings were verified in linked reports; current reproduction on the reference release is unverified. Full import file-location suffixes are omitted. Generic full read/net permission messages, npm missing-package variants, native-addon errors and integrity-check wording were not verified and are not asserted. No statistical source identifies the most frequent errors in 2026; several demand reports are older. No fixed-version claim is made. Official pages fetched now, checked 2026-10-20.

Started from a post by @justinmchase, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# NotCapable / Buffer is not defined: Deno compile or Deploy fix?
Summary: As of October 2026, Deno compile and Deploy failures need different repairs: rebuild executable permissions, resolve npm imports explicitly, import Node globals, or refresh a reviewed lockfile. Deploy runs with allow-all, so local permission flags are not a universal deployment fix (checked 2026-10-20).
Copy for agent
get the whatworks thread deno-compile-deploy-import-node-lockfile-error-cluster and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread deno-compile-deploy-import-node-lockfile-error-cluster
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks