charityroyale / webapplication

A charity page with CMS
MIT License
3 stars 1 forks source link

bugfix: react context #102

Closed p4dd9 closed 1 year ago

p4dd9 commented 1 year ago

fix Collecting page data .TypeError: r.createContext is not a function during build process Error: Failed to collect page data for /_not-found

Steps to reproduce

It seems to be related to ReactContext used in a servercomponent

To investigate Providers using createContext:

p4dd9 commented 1 year ago

https://github.com/pacocoursey/next-themes/issues/152

p4dd9 commented 1 year ago

https://github.com/vercel/next.js/issues/41958

p4dd9 commented 1 year ago

https://github.com/styled-components/styled-components/issues/1589 porting to styled components 6

p4dd9 commented 1 year ago

https://github.com/styled-components/styled-components/commit/8766ec3909ac3fc7d82b00599e1509449b386464#diff-6947e143cd7ea9a496f1403ef3851a643e9775a3439bfd58d615155c62f48176

p4dd9 commented 1 year ago

upgrading to styled-components 6 leads to

- info Collecting page data .TypeError: u.default.createContext is not a function

p4dd9 commented 1 year ago

`Good to know:

To use an async Server Component with TypeScript, ensure you are using TypeScript 5.1.3 or higher and @types/react 18.2.8 or higher.`

https://nextjs.org/docs/app/building-your-application/data-fetching/fetching#async-and-await-in-server-components

p4dd9 commented 1 year ago

https://nextjs.org/docs/getting-started/react-essentials#context

p4dd9 commented 1 year ago

it is related to either page.tsx or its import for singleviews

p4dd9 commented 1 year ago

issue seems to be related to smth else, in PR no dynamic paths are built

p4dd9 commented 1 year ago

react-dom.development.js:6779 Uncaught Error: Hydration failed because the initial UI does not match what was rendered on the server. at throwOnHydrationMismatch

`Warning: An error occurred during hydration. The server HTML was replaced with client content in <#document>.`

`arning: Prop `className` did not match. Server: "sc-hKgJyM kmzcAu" Client: "sc-gKsdJj GYJQf"`
p4dd9 commented 1 year ago

image

p4dd9 commented 1 year ago

https://github.com/charityroyale/webapplication/pull/103 learnings:

p4dd9 commented 1 year ago

so far, only the upcomingstream grid is a bit "off the grid" (hah) - planing to finish soon