vercel/next.js · error · Error

Segment names may not start with erroneous periods ('${segme

Error message

Segment names may not start with erroneous periods ('${segmentName}').

What it means

_insert rejects dynamic segment names that begin with a period after bracket stripping (e.g. a malformed '[.foo]' or a misspelled catch-all). A leading '.' would corrupt the '...' catch-all parsing and periods are invalid in parameter names.

Source

Thrown at packages/next/src/shared/lib/router/utils/sorted-routes.ts:116

        throw new Error(
          `Detected a three-dot character ('…') at ('${segmentName}'). Did you mean ('...')?`
        )
      }

      if (segmentName.startsWith('...')) {
        // Strip `...`, leaving only `something`
        segmentName = segmentName.substring(3)
        isCatchAll = true
      }

      if (segmentName.startsWith('[') || segmentName.endsWith(']')) {
        throw new Error(
          `Segment names may not start or end with extra brackets ('${segmentName}').`
        )
      }

      if (segmentName.startsWith('.')) {
        throw new Error(
          `Segment names may not start with erroneous periods ('${segmentName}').`
        )
      }

      function handleSlug(previousSlug: string | null, nextSlug: string) {
        if (previousSlug !== null) {
          // If the specific segment already has a slug but the slug is not `something`
          // This prevents collisions like:
          // pages/[post]/index.js
          // pages/[id]/index.js
          // Because currently multiple dynamic params on the same segment level are not supported
          if (previousSlug !== nextSlug) {
            // TODO: This error seems to be confusing for users, needs an error link, the description can be based on above comment.
            throw new Error(
              `You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`
            )
          }
        }

View on GitHub (pinned to 0eb3775416)

Solutions

  1. Remove the erroneous leading periods from the segment name.
Defensive patterns

Strategy: validation

When it happens

Trigger: A route segment name starts with erroneous periods.

Common situations: Folder names like '[.slug]' with stray periods inside the brackets.


AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19). Data as JSON: /api/errors/d7fb8b7e14f100be. Report an issue: GitHub.