oven-sh/bun · error · Error

TODO: parse ${match[1]}

Error message

TODO: parse ${match[1]}

What it means

Error "TODO: parse ${match[1]}" thrown in oven-sh/bun.

Source

Thrown at src/codegen/bundle-functions.ts:277

          }
        }
      }

      functions.push({
        name,
        params,
        directives,
        source,
        async,
        enums: constEnumsUsedInFunction,
      });
      contents = rest;
      directives = {};
    } else if (match[1] === "function" || match[1] === "async function") {
      const fnname = contents.match(/^function ([a-zA-Z0-9]+)\(([^)]*)\)(?:\s*:\s*([^{\n]+))?\s*{?/)![1];
      throw new SyntaxError("All top level functions must be exported: " + fnname);
    } else {
      throw new Error("TODO: parse " + match[1]);
    }
  }

  for (const fn of functions) {
    const tmpFile = path.join(TMP_DIR, `${basename}.${fn.name}.ts`);

    // not sure if this optimization works properly in jsc builtins
    // const useThis = fn.usesThis;
    const useThis = true;

    // TODO: we should use format=IIFE so we could bundle imports and extra functions.
    await Bun.write(
      tmpFile,
      `// @ts-nocheck
// GENERATED TEMP FILE - DO NOT EDIT
// Sourced from ${path.relative(TMP_DIR, filename)}
${fn.enums.join("\n")}
// do not allow the bundler to rename a symbol to $

View on GitHub (pinned to 8c5296ac45)

When it happens

Trigger: Thrown at src/codegen/bundle-functions.ts:277 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/0e49f281d3ca1ea7. Report an issue: GitHub.