Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting 'useLayoutEffect' Warning with basic nextjs setup #2294

Open
SanskarDahiya opened this issue Aug 30, 2024 · 1 comment
Open

Getting 'useLayoutEffect' Warning with basic nextjs setup #2294

SanskarDahiya opened this issue Aug 30, 2024 · 1 comment

Comments

@SanskarDahiya
Copy link

🐛 Bug Report

Getting the below mentioned warning

Warning: useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes.
at MyApp (webpack-internal:///./src/pages/_app.tsx:164:18)
at I18nextProvider (/Users/HelloBaby/Projects/TestInternationalisation/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
at AppWithTranslation (/Users/HelloBaby/Projects/TestInternationalisation/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:82:22)
at StyleRegistry (/Users/HelloBaby/Projects/TestInternationalisation/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/styled-jsx/dist/index/index.js:449:36)
at PathnameContextProviderAdapter (/Users/HelloBaby/Projects/TestInternationalisation/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/next/dist/shared/lib/router/adapters.js:60:11)
at AppContainer (/Users/HelloBaby/Projects/TestInternationalisation/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/render.js:290:29)
at AppContainerWithIsomorphicFiberStructure (/Users/HelloBaby/Projects/TestInternationalisation/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/render.js:326:57)
at div
at Body (/Users/HelloBaby/Projects/TestInternationalisation/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/render.js:613:21)

To Reproduce

Versions:
"react": "^18.2.0",
"i18next": "^23.14.0",
"i18next-chained-backend": "^4.6.2",
"i18next-http-backend": "^2.6.1",
"i18next-localstorage-backend": "^4.2.0",
"next-i18next": "^15.3.1",
"react-i18next": "^15.0.1",
"next": "^13.1.6",

A minimal reproducible example.
A codesandbox example or similar
or at least steps to reproduce the behavior:

// Paste your code here

Expected behavior

A clear and concise description of what you expected to happen.

// Paste the expected results here

Your Environment

  • v20.16.0
  • i18next version
  • os: Mac
  • any other relevant information
@adrai
Copy link
Member

adrai commented Aug 30, 2024

You may ask in the Next.js repo.... there is not much we can do here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants