Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error due to Broken Links #37

Closed
cubxxw opened this issue Oct 13, 2023 — with Slack · 3 comments · Fixed by #81
Closed

Build Error due to Broken Links #37

cubxxw opened this issue Oct 13, 2023 — with Slack · 3 comments · Fixed by #81
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

Copy link
Contributor

cubxxw commented Oct 13, 2023

While executing the npm run build command, the build process failed due to broken links detected by Docusaurus. The error message indicates that there are broken links on pages /sdks/api and the Home Page (/). The detailed error message is as follows:

[ERROR] Unable to build website for locale zh-Hans.
[ERROR] Error: Docusaurus found broken links!

Please check the pages of your site in the list below, and make sure you don't reference any path that does not exist.
Note: it's possible to ignore broken links with the 'onBrokenLinks' Docusaurus configuration, and let the build pass.

Exhaustive list of all broken links found:

On source page path = /sdks/api:
-> linking to docs/sdks/api/msg/index.mdx (resolved as: /sdks/docs/sdks/api/msg/index.mdx)

On source page path = /:
-> linking to /restapi/userManagement/userRegister

at throwError (C:\Users\smile\Desktop\web-docs\openim-docs\node_modules@docusaurus\logger\lib\index.js:76:11)
...

Steps to Reproduce:

  1. Clone the repository.
  2. Navigate to the project directory.
  3. Run npm install to install the dependencies.
  4. Run npm run build to build the documentation.

Expected Result:

The documentation should build without any errors.

Actual Result:

The build process fails due to broken links.

Suggested Fix:

  • Verify and update the paths for the broken links on the mentioned pages.
  • Additionally, temporarily setting onBrokenLinks: 'ignore' in docusaurus.config.js allows the build to pass, although it's more advisable to fix the broken links for a better user experience.

Environment:

  • Docusaurus version: (Specify the version of Docusaurus you are using)
  • Node.js version: 14
  • OS: Windows (Specify your OS and its version)

Additional Context:

Add any other context about the problem here.

Attachments:

image

@cubxxw cubxxw added the kind/bug Categorizes issue or PR as related to a bug. label Oct 13, 2023 — with Slack
@kubbot
Copy link
Contributor

kubbot commented Dec 12, 2023

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@kubbot kubbot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 12, 2023
@kubbot
Copy link
Contributor

kubbot commented Dec 20, 2023

This issue was closed because it has been stalled for 7 days with no activity.

@kubbot kubbot closed this as completed Dec 20, 2023
@cubxxw cubxxw reopened this Jan 2, 2024
@cubxxw
Copy link
Contributor Author

cubxxw commented Jan 2, 2024

ubuntu@VM-0-4-ubuntu:~/docs$ npm run build 

> [email protected] build
> docusaurus build

file:///home/ubuntu/docs/node_modules/@docusaurus/core/bin/docusaurus.mjs:30
process.env.BABEL_ENV ??= 'development';
                       ^

SyntaxError: Unexpected token '?'
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
    at async link (internal/modules/esm/module_job.js:42:21)
ubuntu@VM-0-4-ubuntu:~/docs$ npm version 
{
  'openim-docs': '1.20.0',
  npm: '8.5.1',
  node: '12.22.9',
  v8: '7.8.279.23-node.56',
  uv: '1.43.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '72',
  nghttp2: '1.43.0',
  napi: '8',
  llhttp: '2.1.6',
  http_parser: '2.9.4',
  openssl: '1.1.1m',
  cldr: '40.0',
  icu: '70.1',
  tz: '2022a',
  unicode: '14.0'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants