Hmbown/CodeWhale · warning

is deprecated; rename it to .

Error message

${legacy} is deprecated; rename it to ${name}.

What it means

The WeChat bridge reads WEIXIN_* environment variables but also accepts legacy WEXIN_* (typo: missing 'TE') spellings as a fallback. When only the legacy variable is set, the bridge uses its value and prints this one-time deprecation warning per variable name; it is a warning, not a failure.

Solutions

  1. Rename the variable: WEXIN_X -> WEIXIN_X in your .env, shell profile, or CI secret store
  2. Grep your environment (env | grep WEXIN) for all legacy spellings and fix each
  3. Restart the bridge after renaming so it picks up the new names and the warning stops

Example fix

# before (.env)
WEXIN_APPID=wx123
WEXIN_SECRET=abc

# after (.env)
WEIXIN_APPID=wx123
WEIXIN_SECRET=abc
Defensive patterns

Strategy: validation

Validate before calling

for (const k of Object.keys(process.env)) {
  if (k.startsWith('WEXIN_')) console.warn(`${k} is deprecated; rename it to WEIXIN_${k.slice('WEXIN_'.length)}`);
}

Prevention

When it happens

Trigger: weixinEnv(name) finds no WEIXIN_* variable but finds the corresponding WEXIN_* spelling in the environment; the warning is emitted once per legacy name via warnedEnvAliases.

Common situations: Environment files or CI secrets created with the old typo'd names; shell profiles exporting WEXIN_APPID etc. from an older release; copy-pasted deployment scripts predating the rename.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15). Data as JSON: /api/errors/ded5583a0f95daf0. Report an issue: GitHub.

Appendix: source

Thrown at integrations/weixin-bridge/src/index.mjs:101

  if (!value) {
    console.error(`Missing required env: one of ${names.join(", ")}`);
    process.exit(1);
  }
  return value;
}

// WEIXIN_* is the canonical spelling; the historical WEXIN_* typo names are
// still honored as deprecated aliases (each warns once per process).
const warnedEnvAliases = new Set();

function weixinEnv(name) {
  const legacy = `WEXIN_${name.slice("WEIXIN_".length)}`;
  const primary = envFirst(process.env, name);
  if (primary) return primary;
  const fallback = envFirst(process.env, legacy);
  if (fallback && !warnedEnvAliases.has(legacy)) {
    warnedEnvAliases.add(legacy);
    console.warn(`${legacy} is deprecated; rename it to ${name}.`);
  }
  return fallback;
}

const config = {
  runtimeUrl: (
    envFirst(process.env, "CODEWHALE_RUNTIME_URL", "DEEPSEEK_RUNTIME_URL") ||
    "http://127.0.0.1:7878"
  ).replace(/\/+$/, ""),
  runtimeToken: requiredEnvFirst(
    "CODEWHALE_RUNTIME_TOKEN",
    "DEEPSEEK_RUNTIME_TOKEN"
  ),
  workspace:
    envFirst(process.env, "CODEWHALE_WORKSPACE", "DEEPSEEK_WORKSPACE") ||
    process.cwd(),
  model:
    envFirst(process.env, "CODEWHALE_MODEL", "DEEPSEEK_MODEL") || "auto",

View on GitHub (pinned to 433685b202)