Skip to content

Broken link detection in development #6998

Open
@YOU54F

Description

@YOU54F

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

Hello,

I am currently working through our https://docs.pact.io site and we had a number of broken links.

We have now set onBrokenLinks to true, which causes the build the fail. 👍🏾

however as noted in the docs

The broken links detection is only available for a production build (docusaurus build).

I would love to give my contributors earlier feedback, during development as per to onDuplicateRoutes

By default, it displays a warning after you run yarn start or yarn build.

when they run yarn start.

I haven't looked at the codebase, to see the rational for this only being applicable for production builds at the moment.

Thanks in advance and also for the great project!

Reproducible demo

No response

Steps to reproduce

  1. Have a broken link in your docusaurus site
  2. set onBrokenLinks to error
  3. run yarn start and user is not notified there are broken links
  4. run yarn build and build fails with user notified of broken links

Expected behavior

  1. Have a broken link in your docusaurus site
  2. set onBrokenLinks to error
  3. run yarn start and build fails with user notified of broken links
  4. run yarn build and build fails with user notified of broken links

Actual behavior

  1. Have a broken link in your docusaurus site
  2. set onBrokenLinks to error
  3. run yarn start and user is not notified there are broken links

Your environment

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain: dxRelated to developer experience of working on Docusaurus sitesfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions