{"record":{"id":"96c2702ba869c4cc","repo":"remix-run/remix","slug":"optionname-values-must-be-package-names-receiv","errorCode":null,"errorMessage":"${optionName} values must be package names. Received \"${packageName}\".","messagePattern":"(.+?) values must be package names\\. Received \"(.+?)\"\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/assets/src/lib/access.ts","lineNumber":151,"sourceCode":"      return inspect(filePath).allowed\n    },\n  }\n}\n\nfunction normalizePackageNames(\n  packageOption: readonly string[] | undefined,\n  optionName: 'allowPackages',\n): Set<string> {\n  let packageNames = new Set<string>()\n\n  for (let packageName of packageOption ?? []) {\n    if (typeof packageName !== 'string') {\n      throw new TypeError(`${optionName} values must be strings`)\n    }\n\n    let normalizedPackageName = packageName.trim()\n    if (!isValidPackageName(normalizedPackageName)) {\n      throw new TypeError(`${optionName} values must be package names. Received \"${packageName}\".`)\n    }\n\n    packageNames.add(normalizedPackageName)\n  }\n\n  return packageNames\n}\n\nfunction validatePackageName(packageName: string, message: string): void {\n  if (!isValidPackageName(packageName)) {\n    throw new TypeError(message)\n  }\n}\n\ntype PackageJson = {\n  dependencies?: Record<string, string>\n  optionalDependencies?: Record<string, string>\n}","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/assets/src/lib/access.ts#L133-L169","documentation":"Execution-time backstop: any command reaching the migration loader (`migrate`, `rollback`, `status`, `reset`) must have `plan.migrations` set. It duplicates the plan-time check so a hand-built or partially populated plan cannot proceed with an undefined migrations directory. CLI users normally hit the plan-time variant instead.","triggerScenarios":"Programmatically invoking `executeDatabaseCommand` with a plan for a migration command where `migrations === undefined`, skipping `resolveDatabaseCommandPlan`.","commonSituations":"Direct plan construction in scripts/tests; refactors that copy plans between commands and drop the migrations field.","solutions":["Configure `db.migrations.directory` in remix.json or pass `--migrations`","Always build plans through `resolveDatabaseCommandPlan`","Validate the plan shape before executing"],"exampleFix":"// before\nlet plan = { command: 'migrate', db }\nexecuteDatabaseCommand(plan)\n// after\nlet plan = await resolveDatabaseCommandPlan(invocation, dbConfig)\nexecuteDatabaseCommand(plan)","handlingStrategy":"try-catch","validationCode":"if (plan.command !== 'seed' && plan.command !== 'wipe' && plan.migrations === undefined) {\n  throw new Error('Plan is missing a migrations directory');\n}","typeGuard":"function isMigrationPlan(plan: any): plan is { command: string; migrations: string } {\n  return typeof plan.migrations === 'string';\n}","tryCatchPattern":"Catch around executeDatabaseCommand; on 'requires db.migrations.directory' fix remix.json or retry with --migrations.","preventionTips":["Always build plans through the planner","Keep db.migrations.directory configured"],"tags":["cli","database","migrations","invariant"],"backgroundTag":"internal-invariant-violation","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}