gatsbyjs/gatsby · error

The path to the following page is longer than the supported

Error message

The path to the following page is longer than the supported limit on most operating systems and will cause an ENAMETOOLONG error. The path has been truncated to prevent this.

Original Path: ${page.path}

Truncated Path: ${truncatedPath}

What it means

In createPage validation, a path segment exceeds the OS filename length limit (per-segment check via tooLongSegmentsInPath). Such a path would produce an HTML file whose name causes ENAMETOOLONG, so Gatsby truncates the segment, warns with the original and truncated paths, and proceeds with the truncated route.

Source

Thrown at packages/gatsby/src/redux/actions/public.js:397

        page.component = `${page.component}?__contentFilePath=${splitPath[1]}`
      }

      pageComponentCache.set(originalPageComponent, page.component)
    }
  }

  let internalComponentName
  if (page.path === `/`) {
    internalComponentName = `ComponentIndex`
  } else {
    internalComponentName = `Component${page.path}`
  }

  const invalidPathSegments = tooLongSegmentsInPath(page.path)

  if (invalidPathSegments.length > 0) {
    const truncatedPath = truncatePath(page.path)
    report.warn(
      report.stripIndent(`
        The path to the following page is longer than the supported limit on most
        operating systems and will cause an ENAMETOOLONG error. The path has been
        truncated to prevent this.

        Original Path: ${page.path}

        Truncated Path: ${truncatedPath}
      `)
    )
    page.path = truncatedPath
  }

  page.path = applyTrailingSlashOption(page.path, trailingSlash)

  const internalPage: Page = {
    internalComponentName,
    path: page.path,

View on GitHub (pinned to e85d62f177)

Solutions

  1. Shorten the page path / slug in your source data before creating the page
  2. Slugify and cap path segment length in createPage (e.g. slice the slug)
  3. Accept Gatsby's truncation, but note internal links should use the truncated path
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/gatsby/src/redux/actions/public.js:397 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26). Data as JSON: /api/errors/2028461a3eb919ec. Report an issue: GitHub.