Devographics / Monorepo

Monorepo containing the State of JS apps
surveyform-sigma.vercel.app
Other
134 stars 52 forks source link

Fix generateMetadata #412

Closed SachaG closed 3 months ago

SachaG commented 3 months ago

I had to comment out generateMetadata contents to make the app deploy.

https://github.com/Devographics/Monorepo/blob/d810a383dd57a00eba882ac2a4559378e9e369a1/surveyform/src/app/%5Blang%5D/survey/%5Bslug%5D/%5Byear%5D/layout.tsx#L36

https://github.com/Devographics/Monorepo/blob/d810a383dd57a00eba882ac2a4559378e9e369a1/surveyform/src/app/%5Blang%5D/survey/%5Bslug%5D/%5Byear%5D/%5BresponseId%5D/%5BsectionNumber%5D/layout.tsx#L19

eric-burel commented 3 months ago

to be tested but probably an issue when deployment uses multiple process the function that sets the current locale in aserver context was called only in the layout component, but in prod metadata/layouts/pages may live in different processes and not enjoy the same cache I simplified the code so you can "just" pass the localeId to the function, and bypass the complicated use of a server context (wishing for a better API on this, perhaps Next 15.something will improve that)