JavaScript acceleration
In Userspace, commandInterceptors: "auto" (the default) runs eligible JavaScript processes in browser workers. This is the fast path. Linux still owns their files, sockets, process identity, permissions and signals. Other processes run as ordinary Linux programs.
Use your project’s normal commands. OxVM checks each process before it starts, including processes started by npm, pnpm and Bun. A package manager and the application it starts receive separate decisions.
Run your development command
Section titled “Run your development command”Open a terminal in the directory whose package.json defines dev. Choose the command your project uses:
npm run devpnpm run devpnpm devbun run devbun devRun one server at a time. Edit a source file to use the framework’s normal hot reload. Press Ctrl+C to stop the server, then wait for the prompt before starting it again.
The package manager reads your scripts and applies its own lifecycle-hook rules. Arguments, environment variables and working directories keep their normal meaning. npm dev is not an alias for npm run dev; npm reports its usual error.
For SDK applications, use vm.spawn for a development server. See Previews to open its HTTP output.
Why does npm install run in Linux while npm run dev accelerates?
Section titled “Why does npm install run in Linux while npm run dev accelerates?”npm and pnpm are JavaScript programs installed in the image, outside /workspace. When the image declares their package as a code root, their launcher uses the fast path, and so does the application a script starts from your project, such as Vite or Next.js. Each is checked by itself.
A launcher command that installs, updates or removes dependencies (install, ci, add, update, uninstall, rebuild and their aliases) runs in Linux with unsupported-invocation. npm’s installer needs heap statistics that a browser worker cannot report, and installation changes the dependency folders a fast-path launch holds read-only.
Use the process trace to check the launcher and the application separately.
What runs on the fast path
Section titled “What runs on the fast path”A node or bun launch runs on the fast path when all of these hold:
- The runtime is Node.js 24 or Bun 1.3. The engine recognizes the qualified builds, Node.js 24.18.1 and Bun 1.3.14, by their exact bytes. Another binary named
nodeorbun, for example one installed by a version manager, is probed once in a sealed run. Until that probe reports, its launches run in Linux withruntime-probe-pending. - The command line resolves to a supported script run: for example,
node server.js, or a script launched through Bun or a package manager. Node launches may also use--enable-source-maps,-r/--require,-C/--conditions,--warnings/--no-warningsand--deprecation/--no-deprecation. Other flags, such as--importand--max-old-space-size, keep the launch in Linux. A TypeScript entry, such asnode main.tsorbun main.ts, also stays in Linux, where Node strips its types and Bun transpiles it. - The resolved script is in an allowed code location: a
/workspaceproject or a qualified image package, such as npm in the Playground. A path declaration alone does not qualify a package. The engine checks its immutable image content, permissions and links. - The dependencies can be captured safely. The engine finds
node_modulesfrom the script and working directory, supportedNODE_PATHfolders, and linked stores and workspace packages. Installed dependency directories stay read-only for that process. Project source stays editable. Tool caches such as.viteand.cachestay writable. Package stores and launchers under.pnpm,.bunand.binstay frozen. - Every native add-on in those folders that Linux could load passes the add-on checks. Add-ons built for other systems, such as macOS, Windows or Arm, are ignored, because Linux could not load them either.
The same checks apply to child processes. An accelerated parent does not authorize arbitrary child code. A Linux program that an accelerated process starts, such as a shell or a build tool, is an ordinary Linux program. It sees the normal, writable project, including node_modules. The accelerated process itself keeps its read-only dependency folders and does not see changes made to them while it runs. Image package roots include hidden files and remain immutable. Declaring roots does not add them to Node’s package-search paths.
Stop the process before changing installed dependencies, then restart it to use the new dependency generation. Ordinary source edits remain live for HMR.
How add-ons are checked
Section titled “How add-ons are checked”A native add-on is admitted in one of two ways:
- Recognized builds are admitted by their exact SHA-256 with no further check, for example Rollup 4.64.2, SWC 1.15.47 and 1.16.13, and the Next.js 16.2.12 SWC binding.
- Any other add-on is checked by what it needs. It must be a Node-API add-on, not one written against V8 or Node’s C++ interfaces (including NAN). It must be built for musl, not glibc. Every symbol it needs must be provided by the Node-API host or a library it can load. The first time OxVM sees it, it loads the add-on once in a sealed trial in which no application code runs. Later launches reuse that verdict.
An add-on that fails a check sends the program to Linux before it starts, with the reason in the trace, for example addon-not-node-api or addon-glibc. Packages such as sharp, Lightning CSS, Tailwind’s @tailwindcss/oxide, oxc-parser and bufferutil pass these checks. Packages built on V8 or NAN, such as better-sqlite3, run in Linux.
An add-on admitted by its checks may share at most 8 MiB of memory with JavaScript at once. A recognized build may share up to 128 MiB. If a program goes over, it stops once with shared-buffer-budget and its next run uses Linux.
Package installation changes the dependency folders, so its scripts run in Linux. A preinstall, install, postinstall or prepare script started by npm, pnpm, Yarn or Bun, and everything that script starts, is placed in Linux with unsupported-environment and the variable npm_lifecycle_event. Scripts such as dev, build and test are not affected.
Development-command qualification does not cover tools installed or updated globally at runtime. To keep a whole installation in Linux, package manager included, run for example:
OXIDEVM_ACCELERATION=off pnpm installSignal listeners
Section titled “Signal listeners”An accelerated node handles signals the way Node v24 does. Its helper in the image clears the signal mask it inherited and resets inherited ignored signals at startup (SIGPIPE and SIGXFSZ stay ignored, as in Node). SIGINT and SIGTERM are always caught, and any other signal only while JavaScript listens for it with process.on.
Which signals process.on can listen for depends on the image’s helper, native bridge 15, or 16 and later. An image built by this SDK says bridge\t18 in its acceleration profile. An image built by an SDK before bridge 16 has no such row and has bridge 15; that includes the default images until they are rebuilt with a newer helper:
| Bridge | process.on can listen for |
|---|---|
| 16 and later | Every standard signal Node lets JavaScript catch: 1 to 31 except SIGKILL, SIGSTOP, SIGILL, SIGTRAP, SIGBUS, SIGFPE and SIGSEGV, including SIGQUIT, SIGUSR1 and SIGUSR2 |
| 15 | SIGHUP, SIGINT and SIGTERM. A listener for any other signal throws FEATURE_NOT_AVAILABLE with reason: "native-bridge-signal-listener". Rebuild the image with the current SDK to listen for it. |
What runs in full Linux
Section titled “What runs in full Linux”An ineligible process runs in Linux with a reason in the trace. These are common reasons and the next checks to make:
| Reason | What to check |
|---|---|
entry-outside-workspace |
The script is outside /workspace and the qualified image roots. Put project source in /workspace, or use an image that declares the installed tool’s package. |
image-code-unavailable |
A declared path is missing or is not a directory. Check the installed layout and rebuild the image. |
image-code-untrusted |
A declared root is mutable or cannot be verified. Image authors must check its backing, ownership and permissions. |
addon-not-node-api |
A native add-on uses V8 or Node’s C++ interfaces, or registers no Node-API module. It runs in Linux. |
addon-glibc |
A native add-on is built for glibc. It runs in Linux through gcompat. |
addon-unresolved-symbol, addon-library-unavailable |
A native add-on needs a symbol or library the fast path does not provide. The trace names it. |
addon-names-unserved |
A native add-on links a Node-API function the fast path does not provide yet. |
addon-trial-failed, addon-trial-timeout, addon-trial-deferred |
The add-on’s sealed trial load failed, took too long, or has not run yet. |
addon-unqualified |
A native add-on is neither a recognized build nor checked by an image profile. |
runtime-unavailable, runtime-hash-mismatch |
The Node.js or Bun build differs from the qualified runtime. |
runtime-probe-pending, runtime-probe-failed, runtime-family-unsupported |
A node or bun binary outside the qualified builds is still being probed, failed its probe, or is not Node.js 24 or Bun 1.3. |
host-untrusted |
The image’s Node-API host is not a qualified build. |
unsupported-invocation |
Runtime flags or the invocation form are unsupported, the entry is a TypeScript file, or an image-installed package manager runs a command that installs dependencies. |
unsupported-environment |
An environment setting cannot be reproduced, for example unsupported NODE_OPTIONS, or the launch is an install-phase package script (npm_lifecycle_event). The trace names the variable. |
dependency-escape |
A dependency link leaves the permitted project, store or image roots. Check both the link and its final target. |
root-capture-limit, root-capture-unsupported |
The scan exceeds its bounds or contains an unsupported filesystem object. Inspect the dependency and image trees. |
command-capacity |
The limit of 32 accelerated commands is reached. Stop an existing process. |
remembered-failure |
This invocation previously stopped on a recognized fast-path limit. See below. |
placement-override |
The command inherited OXIDEVM_ACCELERATION=off. |
The full list is the AccelerationRejectionReason type in @oxvm/sdk/diagnostics.
When a program needs full Linux after it started
Section titled “When a program needs full Linux after it started”Some unsupported behavior appears only after a process starts. Examples include an unavailable built-in or API, such as node:sqlite, a TypeScript file that the program imports, an add-on call to a Node-API function the fast path does not provide, a worker thread started from source text, a write into the read-only dependency folders, loading a file outside the captured folders, and an add-on going over its shared-memory budget. The process fails explicitly. OxVM never automatically replays it in Linux, because it might already have changed files or answered requests.
For a recognized fast-path limitation, the terminal explains the limit and OxVM remembers the failed invocation. Its next matching run uses Linux. Other unsupported errors also fail explicitly, but are not necessarily remembered. Normal application errors retain their exit status.
For example, an http.request, https.request, HTTP agent or tls.connect option that the fast path does not honor, such as a custom lookup function or a localAddress, is refused when it is set, before any connection opens. If the program does not catch that failure, its next run uses Linux. Options that Node itself never reads, and options that only tune buffers, timers or caches, are ignored. These option checks are available in SDK 0.0.34 or later.
Remembered failures are bound to the runtime, host, entry content, arguments, working project, profile and root content. Changes to those inputs, dependencies, or the engine/SDK cause a new decision. An invalid npm dev command does not suppress a later npm run dev launch.
In the Playground, a recognized limitation can offer Run again, which types the same command at the tab’s prompt. You can also choose Linux explicitly with the environment override below.
The records stay in this browser, per origin. eraseLocalData removes them with the rest of the origin’s OxVM data.
Your app can show recognized limitation notices. Pass an existing Userspace VM, a display callback and an abort signal:
import type { UserspaceVM } from "@oxvm/sdk";import { watchAccelerationNotices } from "@oxvm/sdk/diagnostics";
export function showAccelerationNotices( vm: UserspaceVM, showBanner: (message: string) => void, signal: AbortSignal,): Promise<void> { return watchAccelerationNotices(vm, (notice) => showBanner(notice.message), { signal });}The promise settles when the signal aborts or the VM ends. Await it or handle its rejection. It fails with FEATURE_NOT_AVAILABLE when acceleration is off.
Run one command in Linux
Section titled “Run one command in Linux”To run one command and everything it starts in Linux while the fast path stays on for the rest, set OXIDEVM_ACCELERATION=off in its environment:
OXIDEVM_ACCELERATION=off npm run devAny value other than auto or an empty value means the same.
See each decision
Section titled “See each decision”Enable tracing before starting your command. Read it after the launcher and application have started, or after you stop the command:
import type { UserspaceVM } from "@oxvm/sdk";import { configureJSProcessTrace, readJSProcessTrace } from "@oxvm/sdk/diagnostics";
export function startPlacementTrace(vm: UserspaceVM): Promise<void> { return configureJSProcessTrace(vm, 4096);}
export async function showPlacements(vm: UserspaceVM): Promise<void> { const trace = await readJSProcessTrace(vm); if ((trace.droppedDecisions ?? trace.dropped) > 0n) console.warn("The trace is incomplete. Capture a shorter run."); for (const row of trace.placements) { console.log(row.entry, row.placement, row.placement === "browser" ? row.basis : row.reason); for (const root of row.codeRoots ?? []) { console.log(root.kind, root.path, root.contentSHA256); } }}A browser row carries basis: "qualified" when its native add-ons are recognized builds or listed in the image’s acceleration profile, "verified" when a remembered trial load vouches for at least one add-on, "no-addons", or "trial" for the sealed trial load itself. A Linux row carries its reason, and for an add-on reason also addon, the add-on’s path and what it lacks. trace.failures lists recorded fast-path limitations, each with its kind and message. The trace is bounded. Placements, failures and refusals keep their own queue, and trace.droppedDecisions counts the ones it overwrote. trace.dropped counts overwritten service events. Check droppedDecisions before treating the placements as complete.
For npm or pnpm, look for both the installed CLI entry and the application’s resolved entry. With a qualified image, both have a browser row, except for an installing command, whose CLI entry has a Linux row with unsupported-invocation. Every child is checked separately.
New placement records also list the selected codeRoots. Image roots include contentSHA256; browser rows include the captured dependencyGeneration. Historical traces can omit codeRoots. These fields help image authors check which package tree and generation the engine admitted.