website icon indicating copy to clipboard operation
website copied to clipboard

Link broken in documentation TypeScript > Type Providers

Open danielnmai opened this issue 3 months ago • 6 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.26.2

Plugin version

No response

Node.js version

18.0

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

14.2.1

Description

The Type Providers link leads to a not found page. Screenshot 2024-03-04 at 11 02 39 AM Screenshot 2024-03-04 at 11 04 07 AM

Steps to Reproduce

  1. Go to latest doc on TypeScript support
  2. Click on the Type Providers link
  3. Observe the broken page.

Expected Behavior

The Type Providers page should load correctly.

danielnmai avatar Mar 04 '24 19:03 danielnmai

Should be related to fastify/fastify#5308

matthyk avatar Mar 04 '24 21:03 matthyk

This problem appears with all documentation versions from Fastify version 4.6.x onwards

matthyk avatar Mar 05 '24 13:03 matthyk

Thanks for reporting I found the same issue. The links itself in markdown are correct, I mean the markdown syntax is correct and the location the link is pointing towards.

Could somebody please take a look at this? I don't know what to do.

For example, this link is broken: https://github.com/fastify/fastify/blob/main/docs/Reference/TypeScript.md?plain=1#L214

The build is showing errors:


 It looks like some of the broken links we found appear in many pages of your site.
Maybe those broken links appear on all pages through your site layout?
We recommend that you check your theme configuration for such links (particularly, theme navbar and footer).
Frequent broken links are linking to:
./Validation-and-Serialization.md/
./Type-Providers.md/
./HTTP2.md/
Logging.md/
./Server.md/#register
./Logging.md/

Exhaustive list of all broken links found:

melroy89 avatar Mar 19 '24 14:03 melroy89

I believe something on the TypeScript page (maybe some strange character?) is breaking all the internal links on the Typescript page. Since the broken links are only present in on the TypeScript page.

melroy89 avatar Apr 08 '24 16:04 melroy89

This issue is caused by using triple backticks for inline code blocks at the start of a new line. The Typescript.md file in the current release contains one instance and that breaks every relative link after it.

docusaurus' parser can't handle that case. The fix is to avoid using triple backticks for inline code blocks. Using a single backtick for inline code will work without a problem.

That specific instance in Typescript.md was removed in PR 5361. Any future releases should have working relative links on the typescript page. Is there any process for backporting changes to older versions of the docs? Older versions of the 4.x release will stay broken if this is not fixed.

I found one other instance in the current docs where there triple backticks are used for inline code blocks. I'll submit a PR for that to avoid any future issues.

sehnsucht13 avatar Apr 27 '24 22:04 sehnsucht13

Thank you for mentioning this! I accidentally fixed the ts doc page🙏.

melroy89 avatar Apr 28 '24 07:04 melroy89