Open lp1641 opened 1 month ago
UPD:
If I use
fallback={<>fff</>}
First I see for a brief moment the content of the page and then everything is white.
UPD 2: I tried 1.1.4 version and there was same thing.
Then downgraded.
1.0.1 - at first glance works ok. It doesn't break my project. But now I'm noticing the flickering text when the page is displayed.
1.1.0 - at first glance works ok, no flickering.
But have this error when go back from other page. I have 'use client'; at my root layout so that's strange.
And then after several moves between pages I got this and stuck, even page reload doesn't help.
1.1.1 - errors appears like at latest version
Describe the bug
My next config.
My package json. I have another one at a higher level where there are more libraries. But this should be enough.
To Reproduce Use useScopedI18n and I18nProviderClient in the root layout of your project. You will see a bunch of errors in the Network logs and also on every hot reload refresh there will be an error forcing a full page refresh. It looks like the language file fails to load in time and a hydratation error occurs, the problem is that this greatly hinders local development because it breaks hot reload. If you build the project, then everything will be fine because everything will be rendered in advance if you use generateStaticParams in the root layout. I used millionjs and turbopack with the start parameter "next dev --turbo" but these errors repeat without millionjs and turbopack. I use also svgr and styled components in my project.
Expected behavior I expected there wouldn't be any of these errors.
Screenshots Massive errors about sourcemaps.
![image](https://github.com/user-attachments/assets/693bc3ef-c790-409d-87df-afe4c59787e1)
Example:
Hot reload is broken. Each hot reload leads to following error:![image](https://github.com/user-attachments/assets/990d8c2f-7850-40ce-93b8-469c04101089)
About (please complete the following information):
Additional context I don't know if there are any ways to solve this.
I tried removing I18nProviderClient from the code and replacing the useScopedI18n hook with a stub and the errors stopped. I was trying to check if it could be middleware or something else. Also, if only the hook is replaced with a stub, the errors will still occur because of the provider. So the problem is somewhere in the provider code in my opinion.
Root layout: apps\admin-panel\app[locale]\layout.tsx
apps\admin-panel\modules\main\layouts\RootLayout\index.tsx
Can I wait for language files to be imported first and then render the UI? Perhaps the reason for the error is that the interface is rendered first without the language file and then with it.