remix-run/react-router · error

The `future.v8_splitRouteModules` flag has been moved to a t

Error message

The `future.v8_splitRouteModules` flag has been moved to a top-level `config.splitRouteModules` field (default `true`)

What it means

The `future` config still contains `v8_splitRouteModules` (or its older `unstable_splitRouteModules` alias). That future flag graduated: route module splitting is now controlled by the top-level `splitRouteModules` field and defaults to `true`, so the old flag is rejected with this migration error instead of being ignored.

Source

Thrown at packages/react-router-dev/config/config.ts:703

                  error.loc.column,
                error.frame.trim?.(),
              ]
            : error.stack,
        ]
          .flat()
          .join("\n"),
      );
    }
  }

  // Check for renamed flags and provide helpful error messages
  let futureConfig = userAndPresetConfigs.future;
  if (futureConfig) {
    if (
      "unstable_splitRouteModules" in futureConfig ||
      "v8_splitRouteModules" in futureConfig
    ) {
      return err(
        "The `future.v8_splitRouteModules` flag has been moved to a top-level `config.splitRouteModules` field (default `true`)",
      );
    }
    if (
      "unstable_viteEnvironmentApi" in futureConfig ||
      "v8_viteEnvironmentApi" in futureConfig
    ) {
      return err(
        "The `future.v8_viteEnvironmentApi` flag has been removed because Vite Environment API usage is now always enabled",
      );
    }
    if (
      "unstable_passThroughRequests" in futureConfig ||
      "v8_passThroughRequests" in futureConfig
    ) {
      return err(
        "The `future.v8_passThroughRequests` flag has been removed because pass-through requests are now the default behavior",
      );

View on GitHub (pinned to 6beaca3952)

Solutions

  1. Remove `v8_splitRouteModules`/`unstable_splitRouteModules` from the `future` object.
  2. If you need to disable splitting, set the top-level `splitRouteModules: false` (note the new default is `true`).
  3. Audit remaining `future.*` keys against the current docs — sibling flags may also have stabilized.
  4. Rebuild to confirm config validation passes.

Example fix

// before
export default {
  future: { v8_splitRouteModules: false },
};

// after
export default {
  splitRouteModules: false,
};
Defensive patterns

Strategy: validation

Validate before calling

const MOVED_FLAGS: Record<string, string> = {
  unstable_splitRouteModules: "splitRouteModules",
  v8_splitRouteModules: "splitRouteModules",
  unstable_viteEnvironmentApi: "(removed — always enabled)",
  v8_viteEnvironmentApi: "(removed — always enabled)",
};
for (const key of Object.keys(config.future ?? {})) {
  if (key in MOVED_FLAGS) throw new Error(`future.${key} moved/removed — update config`);
}

Prevention

When it happens

Trigger: A `react-router.config.ts` containing `future: { v8_splitRouteModules: false }` (or `unstable_splitRouteModules`) after upgrading @react-router/dev past the point where the flag stabilized; the check runs whenever any `future` config is present.

Common situations: Upgrading React Router across a minor/major boundary where v8 future flags landed; projects that opted out of module splitting via `false` now needing the inverted top-level setting; configs copied from upgrade guides that are one version behind.

Related errors


AI-assisted analysis of remix-run/react-router@6beaca3952 (2026-08-18). Data as JSON: /api/errors/9d5d153d47307bf1. Report an issue: GitHub.