remix-run/remix · warning · TypeError

Could not resolve allowed package "${packageName}".

Error message

Could not resolve allowed package "${packageName}".

What it means

`remix help <topic>` couldn't match the topic to any known command's help text (including the special `version` case), so `getCommandHelpText` gives up and reports the full unmatched argv. Almost always a typo'd, renamed, or nonexistent command name.

Source

Thrown at packages/assets/src/lib/access.ts:202

}): Map<string, string> {
  let allowPackageRootPaths = new Map<string, string>()
  let allowQueue: PackageRootQueueItem[] = []
  let seenAllowedPackageRoots = new Set<string>()
  let searchRoots = normalizePackageSearchRoots(options.searchRoots)

  for (let packageName of options.allowPackageNames) {
    let foundPackage = false

    for (let searchRoot of searchRoots) {
      let packageJsonPath = findPackageJsonPath(packageName, searchRoot)
      if (packageJsonPath === null) continue

      foundPackage = true
      allowQueue.push({ packageJsonPath, packageName })
    }

    if (!foundPackage) {
      throw new TypeError(`Could not resolve allowed package "${packageName}".`)
    }
  }

  while (allowQueue.length > 0) {
    let { packageJsonPath, packageName } = allowQueue.shift()!
    let packageRootPath = normalizeFilePath(path.dirname(packageJsonPath))
    if (seenAllowedPackageRoots.has(packageRootPath)) continue
    seenAllowedPackageRoots.add(packageRootPath)

    let packageJson = readPackageJson(packageJsonPath)
    allowPackageRootPaths.set(packageRootPath, packageName)

    for (let dependencyName of Object.keys(packageJson.dependencies ?? {})) {
      validatePackageName(
        dependencyName,
        `Dependency "${dependencyName}" from ${packageJsonPath} must be a package name.`,
      )
      let dependencyPackageJsonPath = findPackageJsonPath(dependencyName, packageRootPath)

View on GitHub (pinned to 9696913134)

Solutions

  1. Run bare `remix help` to list available commands and topics
  2. Fix the topic spelling
  3. Check the installed version's docs — the command may have been renamed

Example fix

# before
remix help migrat
# after
remix help migrate
Defensive patterns

Strategy: type-guard

Validate before calling

const knownTopics = await listCommands();
if (!knownTopics.includes(topic)) {
  console.error(`Unknown topic. Available: ${knownTopics.join(', ')}`);
  process.exit(1);
}

Type guard

function isKnownHelpTopic(topic: string, known: readonly string[]): boolean {
  return known.includes(topic);
}

Try / catch

Catch RMX_UNKNOWN_HELP_TOPIC and fall back to printing general help instead of failing the wrapper script.

Prevention

When it happens

Trigger: Running `remix help <unknown>` (e.g. `remix help migrat`, `remix help generate`) where the topic matches no registered command help and isn't `version` with zero rest args.

Common situations: Typos; habits from other frameworks' CLIs; docs referencing removed or renamed commands after an upgrade.

Related errors


AI-assisted analysis of remix-run/remix@9696913134 (2026-08-27). Data as JSON: /api/errors/e2387235add125c2. Report an issue: GitHub.