Frachtwerk / essencium-frontend

Next.js based starter monorepo consisting of a component library, types, docs and a boilerplate application.
https://staging.essencium.dev
GNU Lesser General Public License v3.0
17 stars 1 forks source link

485-props-cancelled-error-in-console #526

Closed PhilKsr closed 6 months ago

PhilKsr commented 6 months ago

DESCRIPTION

Fix the Error: Loading initial props cancelled

TO-DO

CLOSES

closes https://github.com/Frachtwerk/essencium-frontend/issues/485

vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
app ✅ Ready (Inspect) Visit Preview Mar 5, 2024 10:41am
docs ✅ Ready (Inspect) Visit Preview Mar 5, 2024 10:41am
nx-cloud[bot] commented 6 months ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit a42fe93a4272b04326f4aaa106b7215929a1c27d. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets - [`nx build @frachtwerk/essencium-app`](https://cloud.nx.app/runs/pkk2jN91Ye?utm_source=pull-request&utm_medium=comment) - [`nx affected --target=lint --parallel=10`](https://cloud.nx.app/runs/5MVPq55gPa?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.

PhilKsr commented 6 months ago

PR closed for now. It's a bug in next (router). Issue is caused because the next router is initial interrupted by a useEffect to set the locale in the AuthLayout.tsx. Tested several other ways to set the locale in the router but none of them worked. Only known "fix" is to set a timeout to let the router first load the page and serverside props and then replace the same path with the locale.

We agreed on waiting for the next 14 upgrade and investigate the issue again afterwards. If it still shows up and no proper fix is available we thought about a workaround like catching the error and return an empty object to avoid the thrown error.