fix(website): downgrade nextjs

This commit is contained in:
iCrawl
2023-04-07 20:10:20 +02:00
parent 9aafdd6214
commit f195556b64
3 changed files with 27 additions and 24 deletions

View File

@@ -60,7 +60,7 @@
"bright": "^0.7.1",
"cmdk": "^0.2.0",
"meilisearch": "^0.32.2",
"next": "^13.3.0",
"next": "^13.2.5-canary.34",
"next-mdx-remote": "^4.4.1",
"next-themes": "^0.2.1",
"react": "^18.2.0",
@@ -71,6 +71,7 @@
"rehype-raw": "^6.1.1",
"rehype-slug": "^5.1.0",
"remark-gfm": "^3.0.1",
"server-only": "^0.0.1",
"sharp": "^0.32.0",
"swr": "^2.1.2"
},

View File

@@ -1,7 +1,8 @@
import 'server-only';
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
import { connect } from '@planetscale/database';
import { cache } from 'react';
const sql = connect({ url: process.env.DATABASE_URL! });
@@ -13,7 +14,7 @@ export async function fetchVersions(packageName: string): Promise<string[]> {
return response.json();
}
export const fetchModelJSON = cache(async (packageName: string, version: string): Promise<unknown> => {
export async function fetchModelJSON(packageName: string, version: string): Promise<unknown> {
if (process.env.NEXT_PUBLIC_LOCAL_DEV) {
const res = await readFile(
join(process.cwd(), '..', '..', 'packages', packageName, 'docs', 'docs.api.json'),
@@ -35,4 +36,4 @@ export const fetchModelJSON = cache(async (packageName: string, version: string)
// @ts-expect-error: https://github.com/planetscale/database-js/issues/71
return rows[0].data;
});
}