remix-run/remix · error · CliError

RMX_INVALID_CONFIG

RMX_INVALID_CONFIG

Error message

${filePath}:${line}:${column}: ${details}

What it means

Internal helper for Remix config validation: it locates the JSON node at `propertyPath` in the parsed config source, computes line/column, and throws RMX_INVALID_CONFIG with a `${filePath}:${line}:${column}: ${details}` message. It is raised for any schema or semantic violation found while validating the config file.

Source

Thrown at packages/cli/src/lib/remix-config.ts:738

  if (closingIndex === -1) return undefined

  return {
    flags: pattern.slice(closingIndex + 1),
    source: pattern.slice(1, closingIndex),
  }
}

function throwConfigError(
  source: ConfigSource,
  propertyPath: JsonPath,
  details: string,
  offset?: number,
): never {
  let node = source.root == null ? undefined : findNodeAtLocation(source.root, propertyPath)
  let location = getLineAndColumn(source.text, offset ?? node?.offset ?? 0)
  let label = propertyPath.length === 0 ? '' : ` at ${propertyPath.join('.')}`
  throw invalidRemixConfig(source.filePath, `${details}${label}`, location.line, location.column)
}

function getLineAndColumn(text: string, offset: number): { column: number; line: number } {
  let line = 1
  let column = 1

  for (let index = 0; index < offset; index++) {
    if (text[index] === '\n') {
      line++
      column = 1
    } else {
      column++
    }
  }

  return { column, line }
}

View on GitHub (pinned to 9696913134)

Solutions

  1. Read the `file:line:column` in the message and fix the property at that exact location
  2. Compare your config against the current config schema/types for your Remix version
  3. Remove or correct the offending key named after 'at <propertyPath>'

Example fix

// before (remix.config.ts)
export default { ports: '3000' }
// after
export default { ports: 3000 }
Defensive patterns

Strategy: try-catch

Try / catch

catch (error) {
  if (error instanceof Error && error.code === 'RMX_INVALID_CONFIG') {
    // parse file:line:column from message and surface to editor
    const [loc] = error.message.split(':').slice(1, 4)
  }
  throw error
}

Prevention

When it happens

Trigger: A config file with an invalid value for a known property — wrong type, unknown nested key, or failed validation — surfaced during loadConfig/loadRemixConfig validation passes.

Common situations: Typos in config keys, wrong value types (string vs number), or using config options removed/renamed between Remix versions.

Understand the failure class

Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.

Related errors


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