{"record":{"id":"2fca01ffa54496f7","repo":"remix-run/remix","slug":"asset-configuration-is-missing-from-remix-json","errorCode":null,"errorMessage":"Asset configuration is missing from remix.json.","messagePattern":"Asset configuration is missing from remix\\.json\\.","errorType":"exception","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/lib/commands/assets.ts","lineNumber":26,"sourceCode":"  assetsConfigRequired,\n  invalidOptionValue,\n  renderCliError,\n  toCliError,\n  unknownCommand,\n} from '../errors.ts'\nimport { formatHelpText } from '../help-text.ts'\nimport { parseArgs } from '../parse-args.ts'\n\nexport async function runAssetsCommand(argv: string[], context: CliContext): Promise<number> {\n  if (argv.includes('-h') || argv.includes('--help')) {\n    process.stdout.write(getAssetsCommandHelpText())\n    return 0\n  }\n\n  try {\n    let invocation = parseAssetsCommandArgs(argv)\n    let config = await context.loadConfig()\n    if (config.assets === undefined) throw assetsConfigRequired()\n\n    let assetServer = createAssetServer({ ...config.assets, watch: false })\n    try {\n      let rootDir = fs.realpathSync(config.assets.rootDir)\n\n      if (invocation.command === 'list') {\n        process.stdout.write(formatAssetList(await assetServer.getAssets(), rootDir))\n      } else {\n        process.stdout.write(\n          formatAssetDetails(await assetServer.getAssetDetails(invocation.input), rootDir),\n        )\n      }\n    } finally {\n      await assetServer.close()\n    }\n\n    return 0\n  } catch (error) {","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/cli/src/lib/commands/assets.ts#L8-L44","documentation":"The remix assets subcommand requires an assets configuration block, but remix.json (or the loaded config file) has no assets key, so no asset server can be constructed. This is a configuration prerequisite error, not a runtime failure.","triggerScenarios":"Running remix assets list or remix assets inspect in a project whose config lacks an assets section; config loaded from a custom --config file that omits assets.","commonSituations":"New projects scaffolded without the asset pipeline enabled; renaming or restructuring remix.json and dropping the assets block; pointing --config at the wrong file.","solutions":["Add an assets section (rootDir, files.extensions, mounts as needed) to remix.json","Verify you are in the right project directory / using the intended --config file","Regenerate or copy the assets block from a working project template"],"exampleFix":"// before: remix.json\n{ \"app\": { \"root\": \"app\" } }\n\n// after\n{ \"app\": { \"root\": \"app\" }, \"assets\": { \"rootDir\": \".\", \"mounts\": { \"/\": \"app\" } } }","handlingStrategy":"validation","validationCode":"let config = await loadConfig()\nif (config.assets === undefined) {\n  throw new Error('Add an \"assets\" block to remix.json before running asset commands')\n}","typeGuard":"function hasAssetsConfig(config: unknown): config is { assets: object } {\n  return typeof config === 'object' && config !== null && 'assets' in config && config.assets != null\n}","tryCatchPattern":"try {\n  await runAssetsCommand(argv, context)\n} catch (error) {\n  if (/missing from remix.json/i.test(error.message)) linkToAssetsDocs()\n  else throw error\n}","preventionTips":["Include the assets block in project templates from day one","Validate config presence in tooling that shells out to remix assets","Point --config at the intended file when running outside the project root"],"tags":["cli","assets","config"],"backgroundTag":"missing-config-section","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}