Skip to content

Commit fb52441

Browse files
committed
fix: build
1 parent 01a3cd7 commit fb52441

6 files changed

Lines changed: 71 additions & 54 deletions

File tree

package-lock.json

Lines changed: 48 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projects/wp-nextjs-app/src/app/(single)/[...path]/page.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ const ClientRelatedPosts = dynamic(() =>
1212
import('../../../components/RelatedPosts').then((mod) => mod.RelatedPosts),
1313
);
1414

15-
export async function generateStaticParams({ params }: HeadstartWPRoute) {
16-
// loads the right config based on route params (this is needed over getHeadstartWP for sites using polylang integration or multisite)
15+
export async function generateStaticParams({
16+
params,
17+
}: {
18+
params: Awaited<HeadstartWPRoute['params']>;
19+
}) {
20+
// @ts-expect-error - params is a promise
1721
const { sourceUrl = '', hostUrl = '/' } = await loadHeadstartWPConfig(params);
1822

1923
const { data } = await queryPosts({
20-
routeParams: await params,
24+
routeParams: params,
2125
params: { postType: 'post' },
2226
});
2327

projects/wp-nextjs/next-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
/// <reference path="./.next/types/routes.d.ts" />
34

45
// NOTE: This file should not be edited
56
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.

projects/wp-polylang-nextjs-app/src/app/[lang]/(single)/[...path]/page.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@ import {
88
} from '@headstartwp/next/app';
99
import Blocks from '../../../../components/Blocks';
1010

11-
export async function generateStaticParams({ params }: HeadstartWPRoute) {
11+
export async function generateStaticParams({
12+
params,
13+
}: {
14+
params: Awaited<HeadstartWPRoute['params']>;
15+
}) {
1216
// loads the right config based on route params (this is needed over getHeadstartWPConfig() for sites using multisite)
17+
// @ts-expect-error - params is a promise
1318
const { sourceUrl = '', hostUrl = '/' } = await loadHeadstartWPConfig(params);
1419

1520
// do not throw if there aren't any posts
1621
const { data } = await queryPosts({
17-
routeParams: await params,
22+
routeParams: params,
1823
params: { postType: 'post' },
1924
options: {
2025
throwIfNotFound: false,

test-projects/wp-nextjs-epio/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
"@types/react": "^18",
2424
"@types/react-dom": "^18",
2525
"eslint": "^8",
26-
"eslint-config-next": "14.2.3"
26+
"eslint-config-next": "15.5.7"
2727
}
2828
}

test-projects/wp-nextjs-universal-blocks/src/app/(single)/[...path]/page.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@ const ClientRelatedPosts = dynamic(() =>
1212
import('../../../components/RelatedPosts').then((mod) => mod.RelatedPosts),
1313
);
1414

15-
export async function generateStaticParams({ params }: HeadstartWPRoute) {
15+
export async function generateStaticParams({
16+
params,
17+
}: {
18+
params: Awaited<HeadstartWPRoute['params']>;
19+
}) {
1620
// loads the right config based on route params (this is needed over getHeadstartWP for sites using polylang integration or multisite)
21+
// @ts-expect-error - params is a promise
1722
const { sourceUrl = '', hostUrl = '/' } = await loadHeadstartWPConfig(params);
1823

1924
const { data } = await queryPosts({
20-
routeParams: await params,
25+
routeParams: params,
2126
params: { postType: 'post' },
2227
});
2328

0 commit comments

Comments
 (0)