Skip to content

Commit cd389bc

Browse files
authored
fix(build): fix js error by updating next and fix header usage (#503)
1 parent 204ba1e commit cd389bc

File tree

6 files changed

+79
-80
lines changed

6 files changed

+79
-80
lines changed

app/evenement/[slug]/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { Metadata } from 'next';
99

1010
export const revalidate = 3600;
1111

12-
export default async function EventPage({ params: { slug } }: { params: { slug: string } }) {
12+
export default async function EventPage({ params }: { params: Promise<{ slug: string }> }) {
13+
const { slug } = await params;
1314
const eventId = parserEventIdFromSlug(slug);
1415
if (!eventId) {
1516
notFound();
@@ -28,7 +29,8 @@ export default async function EventPage({ params: { slug } }: { params: { slug:
2829
}
2930
}
3031

31-
export async function generateMetadata({ params: { slug } }: { params: { slug: string } }): Promise<Metadata> {
32+
export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise<Metadata> {
33+
const { slug } = await params;
3234
const eventId = parserEventIdFromSlug(slug);
3335
if (!eventId) {
3436
return {};

app/evenements-precedents/[year]/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ import { Metadata } from 'next';
44
import { PastEvents } from './pastEvents';
55

66
export const revalidate = 3600;
7+
const DEFAULT_YEAR = `${new Date().getFullYear()}`;
8+
9+
export default async function PastEventsPage({ params }: { params: Promise<{ year?: string }> }) {
10+
const { year = DEFAULT_YEAR } = await params;
711

8-
export default async function PastEventsPage({ params: { year } }: { params: { year: string } }) {
912
return (
1013
<main>
1114
<H1>Évènements précédents</H1>
@@ -14,7 +17,8 @@ export default async function PastEventsPage({ params: { year } }: { params: { y
1417
);
1518
}
1619

17-
export async function generateMetadata({ params: { year } }: { params: { year: string } }): Promise<Metadata> {
20+
export async function generateMetadata({ params }: { params: Promise<{ year?: string }> }): Promise<Metadata> {
21+
const { year = DEFAULT_YEAR } = await params;
1822
const title = `LyonJS | Évènements ${year}`;
1923
const description = `Liste des évènements LyonJS de l'année ${year}, meetup, apéros, conférences et rassemblement, retrouver tous les liens depuis notre création.`;
2024

app/layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ import { ORGANISATION_MARKUP } from './org-markup';
1515

1616
dayjs.locale('fr');
1717

18-
export default function AppLayout({ children }: { children: ReactNode }) {
19-
const nonce = headers().get('x-nonce');
18+
export default async function AppLayout({ children }: { children: ReactNode }) {
19+
const header = await headers();
20+
const nonce = header.get('x-nonce');
2021

2122
return (
2223
<html lang="fr-FR">

modules/event/components/EventDetail.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use client';
21
import Image from 'next/image';
32
import { H1 } from '../../atoms/remark/Titles';
43
import type { Event } from '../types';

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"packageManager": "[email protected]",
66
"scripts": {
7-
"dev": "next dev",
7+
"dev": "next dev --turbopack",
88
"build": "next build",
99
"start": "next start",
1010
"export": "next export",
@@ -21,7 +21,7 @@
2121
"dayjs": "^1.11.13",
2222
"lodash": "^4.17.21",
2323
"motion": "^10.18.0",
24-
"next": "14.2.23",
24+
"next": "15.2.2",
2525
"normalize.css": "8.0.1",
2626
"react": "19.0.0",
2727
"react-dom": "19.0.0",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)