windmill-labs/windmill · error

Unknown language ' '. Valid languages

Error message

Unknown language '${language}'. Valid languages: ${validLanguages}

What it means

`wmill script bootstrap` resolves the requested language through `languageAliases`, then looks up starter code in `scriptBootstrapCode`. If no bootstrap template exists for the (resolved) language, it throws with the sorted list of valid languages.

Solutions

  1. Use one of the languages listed in the error message.
  2. Check for a language alias (e.g. `deno` for typescript-deno) supported by your CLI version.
  3. Update the CLI (`npm i -g windmill-cli` or `brew upgrade wmill`) if the language is newer than your installed version.
  4. Run `wmill script bootstrap --help` to see accepted values.

Example fix

// before
wmill script bootstrap f/my_script js
// after
wmill script bootstrap f/my_script typescript
Defensive patterns

Strategy: validation

Validate before calling

const valid = ['python','typescript','go','shell','bun','deno','ansible','bash','powershell','php','rust','sql','nunjucks','graphql'];
if (!valid.includes(lang)) {
  throw new Error(`Language '${lang}' not supported; use one of: ${valid.join(', ')}`);
}

Type guard

function isSupportedLanguage(l: string): l is SupportedLanguage {
  return ['python','typescript','go','shell','bun','deno'].includes(l);
}

Try / catch

try {
  await wmill.script.bootstrap(path, lang);
} catch (e) {
  if (String(e.message).startsWith('Unknown language')) {
    console.error(e.message); // message lists valid languages
  }
  throw e;
}

Prevention

When it happens

Trigger: `wmill script bootstrap my_script <lang>` with a misspelled or unsupported language value, e.g. `python3` when only `python` is aliased, `js` instead of `typescript`, or `bash` instead of `shell`/`bun`.

Common situations: Typing a language name from another tool's vocabulary (`golang` vs `go`, `py` vs `python`); copying a command from docs for a Windmill version that doesn't support that language yet; shell tab-completion inserting the file extension (`.ts`) instead of the language name.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/f6b1fdc1b139c7dc. Report an issue: GitHub.

Appendix: source

Thrown at cli/src/commands/script/script.ts:1634

const languageAliases: Record<string, ScriptLanguage> = {
  python: "python3",
};

async function bootstrap(
  opts: GlobalOptions & { summary: string; description: string },
  scriptPath: string,
  language: ScriptLanguage | string
) {
  if (!validatePath(scriptPath)) {
    return;
  }

  const resolvedLanguage = (languageAliases[language] ?? language) as ScriptLanguage;

  const scriptInitialCode = scriptBootstrapCode[resolvedLanguage];
  if (scriptInitialCode === undefined) {
    const validLanguages = Object.keys(scriptBootstrapCode).sort().join(", ");
    throw new Error(
      `Unknown language '${language}'. Valid languages: ${validLanguages}`
    );
  }

  const config = await readConfigFile();

  const extension = filePathExtensionFromContentType(
    resolvedLanguage,
    config.defaultTs
  );
  const scriptCodeFileFullPath = scriptPath + extension;
  const scriptMetadataFileFullPath = scriptPath + ".script.yaml";

  try {
    await stat(scriptCodeFileFullPath);
    throw new Error("File already exists: " + scriptCodeFileFullPath);
  } catch (e: any) {
    if (e.message?.startsWith("File already exists")) throw e;

View on GitHub (pinned to e474e8803c)