diff --git a/packages/docusaurus/src/client/preload.ts b/packages/docusaurus/src/client/preload.ts index 4434e929fd..a4faa7750d 100644 --- a/packages/docusaurus/src/client/preload.ts +++ b/packages/docusaurus/src/client/preload.ts @@ -17,7 +17,7 @@ import {matchRoutes} from 'react-router-config'; * @returns Promise object represents whether pathname has been preloaded */ export default function preload(pathname: string): Promise { - const matches = [pathname, decodeURI(pathname)] + const matches = Array.from(new Set([pathname, decodeURI(pathname)])) .map(p => matchRoutes(routes, p)) .flat();