sentry-javascript
sentry-javascript copied to clipboard
`generateMetadata` breaks `cacheComponents` on turbopack
Description
ref https://github.com/getsentry/sentry-javascript/issues/17895
For the time being we only experienced this error when running the dev server, not any production build.
it is happening in dev and production
@joacub are you building with turbopack?
Turbopack and error in production
@albertocubeddu could you provide a reproduction where this breaks in prod?
aks in prod?
any segment that use async generateMetadata will fail
import AffiliatesGeneral from '@wsy/ui/AffiliatesGeneral/AffiliatesGeneral';
import { Metadata } from 'next';
import { openGraph, twitter } from '@wsy/web/shared-metadata';
import translate from '../../../translate';
export async function generateMetadata({ params }): Promise<Metadata> {
const titleLocale = await translate({
locale: (await params).lang,
id: 'affiliateProgramTermsAndConditions',
defaultMessage: 'Affiliate Program Terms and Conditions ',
});
const title = titleLocale.format() as string;
return {
title,
openGraph: {
...openGraph,
title,
},
twitter: {
...twitter,
title,
},
};
}
const Page = () => {
return <AffiliatesGeneral />;
};
export default Page;