oven-sh/bun · error · Error
This script is not meant to be run directly
Error message
This script is not meant to be run directly
What it means
Error "This script is not meant to be run directly" thrown in oven-sh/bun.
Source
Thrown at src/codegen/bundle-functions.ts:58
// The output is intended to be similar to what WebCore does, but they use a
// python script, and they write all the `@` syntax by hand. When generating,
// we concatenate all the sources into one big string, which then creates a
// single JSC::SourceProvider. Passing start/end positions to each function's
// JSC::SourceCode. JSC does this, but WebCore does not seem to as of writing.
import assert from "assert";
import { readdirSync, rmSync } from "fs";
import path from "path";
import { sliceSourceCode } from "./builtin-parser";
import { createAssertClientJS, createLogClientJS } from "./client-js";
import { getJS2NativeDTS } from "./generate-js2native";
import { cap, checkAscii, low, writeIfNotChanged } from "./helpers";
import { applyGlobalReplacements, define } from "./replacements";
const PARALLEL = false;
const KEEP_TMP = true;
if (import.meta.main) {
throw new Error("This script is not meant to be run directly");
}
const CMAKE_BUILD_ROOT = globalThis.CMAKE_BUILD_ROOT;
if (!CMAKE_BUILD_ROOT) {
throw new Error("CMAKE_BUILD_ROOT is not defined");
}
const SRC_DIR = path.join(import.meta.dir, "../js/builtins");
const CODEGEN_DIR = path.join(CMAKE_BUILD_ROOT, "./codegen");
const TMP_DIR = path.join(CMAKE_BUILD_ROOT, "./tmp_functions");
interface ParsedBuiltin {
name: string;
params: string[];
directives: Record<string, any>;
source: string;
async: boolean;
enums: string[];View on GitHub (pinned to 8c5296ac45)
When it happens
Trigger: Thrown at src/codegen/bundle-functions.ts:58 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/d48235444a5a4bf2.
Report an issue: GitHub.