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
- Read the `file:line:column` in the message and fix the property at that exact location
- Compare your config against the current config schema/types for your Remix version
- 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
- Type-check configs against exported config types
- Use an editor with the Remix config JSON/TS schema for early feedback
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
- throw new AssertionError({ message, actual, expected, operat
- expect(received).toThrow() requires a function (got ${typeof
- expected promise to resolve, but it rejected with: ${stringi
- expected promise to reject, but it resolved with: ${stringif
- throw new TypeError(message)
AI-assisted analysis of remix-run/remix@9696913134 (2026-08-27).
Data as JSON: /api/errors/f1ce9e3fd58bdc83.
Report an issue: GitHub.