Skip to content

Commit 037addc

Browse files
committed
chore: resolve console errors for prefetching /docs/latest
1 parent 494b993 commit 037addc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

site/pages/docs/[version]/[[...slug]].jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ DocsPage.propTypes = {
130130

131131
export async function getStaticProps({ params }) {
132132
const slug = params.slug?.[0] ?? '';
133+
if(params.version === 'latest') {
134+
params.version = apiVersions[0].value;
135+
}
136+
133137
const isValidVersion = apiVersions.find(ver => ver.value === params.version);
134138

135139
if(!isValidVersion) {
@@ -172,7 +176,7 @@ export async function getStaticProps({ params }) {
172176
}
173177

174178
export async function getStaticPaths() {
175-
const paths = [];
179+
const paths = [{ params: { version: 'latest', slug: [] } }];
176180

177181
for(const ver of apiVersions) {
178182
// eslint-disable-next-line no-await-in-loop

0 commit comments

Comments
 (0)