fix: dont cache nextjs cache

This commit is contained in:
iCrawl
2023-11-13 19:31:55 +01:00
parent b150d4ac27
commit d4ebc369ca
6 changed files with 62 additions and 66 deletions

View File

@@ -53,7 +53,7 @@
"ariakit": "2.0.0-next.44",
"cmdk": "^0.2.0",
"contentlayer": "^0.3.4",
"next": "14.0.3-canary.2",
"next": "14.0.3-canary.5",
"next-contentlayer": "^0.3.4",
"next-themes": "^0.2.1",
"react": "^18.2.0",
@@ -65,7 +65,7 @@
"sharp": "^0.32.6"
},
"devDependencies": {
"@next/bundle-analyzer": "14.0.3-canary.2",
"@next/bundle-analyzer": "14.0.3-canary.5",
"@testing-library/react": "^14.1.0",
"@testing-library/user-event": "^14.5.1",
"@types/html-escaper": "^3.0.2",

View File

@@ -62,7 +62,7 @@
"class-variance-authority": "^0.7.0",
"cmdk": "^0.2.0",
"meilisearch": "^0.35.0",
"next": "14.0.3-canary.2",
"next": "14.0.3-canary.5",
"next-mdx-remote": "^4.4.1",
"next-themes": "^0.2.1",
"react": "^18.2.0",
@@ -74,7 +74,7 @@
"sharp": "^0.32.6"
},
"devDependencies": {
"@next/bundle-analyzer": "14.0.3-canary.2",
"@next/bundle-analyzer": "14.0.3-canary.5",
"@testing-library/react": "^14.1.0",
"@testing-library/user-event": "^14.5.1",
"@types/node": "18.18.8",

View File

@@ -122,7 +122,7 @@ export async function generateStaticParams({ params: { package: packageName, ver
const modelJSON = await fetchModelJSON(packageName, version);
if (!modelJSON) {
return [{ package: packageName, version, item: '' }];
return [];
}
const model = addPackageToModel(new ApiModel(), modelJSON);
@@ -131,7 +131,7 @@ export async function generateStaticParams({ params: { package: packageName, ver
const entry = pkg?.entryPoints[0];
if (!entry) {
return [{ package: packageName, version, item: '' }];
return [];
}
return entry.members.map((member: ApiItem) => ({

View File

@@ -15,10 +15,6 @@ const loadREADME = cache(async (packageName: string) => {
return readFile(join(process.cwd(), 'src', 'assets', 'readme', packageName, 'home-README.md'), 'utf8');
});
export async function generateStaticParams({ params }: { params: VersionRouteParams }) {
return [{ package: params.package, version: params.version }];
}
export default async function Page({ params }: { params: VersionRouteParams }) {
const readmeSource = await loadREADME(params.package);
const { content } = await compileMDX({