Skip to content

Fix duplicate redirect paths causing Docusaurus build failure#77

Draft
Copilot wants to merge 13 commits intomainfrom
copilot/configure-redirects-from-docs
Draft

Fix duplicate redirect paths causing Docusaurus build failure#77
Copilot wants to merge 13 commits intomainfrom
copilot/configure-redirects-from-docs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 31, 2026

Docusaurus build failed with EEXIST: file already exists error when attempting to create redirect files. The redirect configuration contained duplicate "from" paths across multiple redirect objects.

Changes

  • Removed duplicate redirect configuration for /documentation/references and /documentation/references.html
    • These paths appeared in two separate redirect objects, both targeting /docs/references/configuration/
    • Kept paths in main configuration block alongside related redirects
    • Reduced total configurations from 48 to 47

Impact

  • All 213 redirect paths are now unique (previously 216 with 3 duplicates)
  • Build no longer attempts to create same redirect file twice
  • No functional change to redirects - all paths still work as intended

Example of removed duplication

Before: Two separate configurations redirecting to same target

// Configuration 1 (kept)
{
  from: [
    '/documentation/configuration',
    '/documentation/references',        // duplicate
    '/documentation/references.html',   // duplicate
    '/references/configuration',
    ...
  ],
  to: '/docs/references/configuration/'
}

// Configuration 2 (removed)
{
  from: [
    '/documentation/references',
    '/documentation/references.html',
    '/documentation/references/'
  ],
  to: '/docs/references/configuration/'
}
Original prompt

Configure all redirects from docs.specmatic.io into the new specmatic-documentation repo which is docusaurus based.

You can find the redirects in the docs.specmatic.io in specific md files.
e.g. @specmatic/docs.specmatic.io/files/contract_driven_development/backward_compatibility.md
i.e. layout: default
title: Backward Compatibility
parent: Contract Driven Development
nav_order: 3
redirect_from:

  • /backward_compatibility.html
  • /documentation/backward_compatibility.html
  • /documentation/tutorials/backward_compatibility.html

And you'll have to configure it in the file docusaurus.config.js -
@specmatic/specmatic-documentation/files/docusaurus.config.js

Make sure you do not miss a single redirect config from docs.specmatic.io while migrating those to specmatic-documentation.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 31, 2026 07:21
…tion

- Extracted redirects from 50 markdown files
- Generated 48 redirect configurations covering 200+ redirect paths
- Updated docusaurus.config.js with complete redirect configuration
- Included both .html and non-.html variants for all redirects
- Applied special path mappings for renamed files
- Validated JavaScript syntax

Co-authored-by: yogeshnikam671 <60032699+yogeshnikam671@users.noreply.github.com>
- Fix inconsistent path naming (use hyphens throughout)
- Fix missing leading slashes in redirect paths
- Fix incorrect file count in documentation (48 files, not 50)
- Ensure all redirect paths are absolute

Co-authored-by: yogeshnikam671 <60032699+yogeshnikam671@users.noreply.github.com>
Co-authored-by: yogeshnikam671 <60032699+yogeshnikam671@users.noreply.github.com>
Copilot AI changed the title [WIP] Configure all redirects for specmatic documentation Configure redirects from docs.specmatic.io to Docusaurus-based documentation Jan 31, 2026
Copilot AI requested a review from yogeshnikam671 January 31, 2026 07:29
Copilot AI and others added 4 commits January 31, 2026 07:48
CORRECTIONS:
1. Repository: Redirects belong in specmatic-documentation, not docs.specmatic.io
2. Path Format: Use underscores (contract_driven_development) not hyphens (contract-driven-development)

Changes:
- Created corrected docusaurus.config.js.CORRECTED with proper underscore paths
- Verified all 40 unique redirect targets exist in specmatic-documentation
- Fixed missing pages to redirect to appropriate alternatives
- Removed incorrect files (docusaurus.config.js, REDIRECT_MIGRATION.md)
- Created REDIRECT_FIX_README.md with complete documentation

Co-authored-by: yogeshnikam671 <60032699+yogeshnikam671@users.noreply.github.com>
Co-authored-by: yogeshnikam671 <60032699+yogeshnikam671@users.noreply.github.com>
Co-authored-by: yogeshnikam671 <60032699+yogeshnikam671@users.noreply.github.com>
Co-authored-by: yogeshnikam671 <60032699+yogeshnikam671@users.noreply.github.com>
Copilot AI changed the title Configure redirects from docs.specmatic.io to Docusaurus-based documentation Correct redirect configuration: fix repository and path format Jan 31, 2026
Copilot AI and others added 3 commits January 31, 2026 08:07
- Created READY_TO_USE_docusaurus.config.js for easy copy/paste
- Added missing .html versions to all redirects (now 216 total paths)
- All paths use correct underscore format (contract_driven_development)
- All 40 unique targets verified to exist
- JavaScript syntax validated
- Created simple HOW_TO_USE.md instructions

Co-authored-by: yogeshnikam671 <60032699+yogeshnikam671@users.noreply.github.com>
Co-authored-by: yogeshnikam671 <60032699+yogeshnikam671@users.noreply.github.com>
Co-authored-by: yogeshnikam671 <60032699+yogeshnikam671@users.noreply.github.com>
Copilot AI changed the title Correct redirect configuration: fix repository and path format Provide ready-to-use docusaurus.config.js with complete redirect coverage Jan 31, 2026
Copilot AI and others added 2 commits January 31, 2026 09:12
- Removed duplicate /documentation/references paths
- Fixed "EEXIST: file already exists" build error
- Reduced from 48 to 47 redirect configurations
- All 213 redirect paths are now unique
- JavaScript syntax validated
- Build should now succeed

Co-authored-by: yogeshnikam671 <60032699+yogeshnikam671@users.noreply.github.com>
Co-authored-by: yogeshnikam671 <60032699+yogeshnikam671@users.noreply.github.com>
Copilot AI changed the title Provide ready-to-use docusaurus.config.js with complete redirect coverage Fix duplicate redirect paths causing Docusaurus build failure Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants