-
Notifications
You must be signed in to change notification settings - Fork 27k
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
"error createContext only works in Client Components" still exists #60877
Comments
Hey @sheetalsindhu, could you please delete your |
@sheetalsindhu add "use client" on the component with the create context only. Then wrap the component in your layout or where you intend to use it e.g this is a client auth provider wrapped over other components |
I got same error when i use @next/mdx, If this error occurs when you also use mdx, ensure |
I got the same error, after moving |
I got the same error trying to migrate from Pages to App. I put the 'use client' at the beginning of my Context, but it doesn't work. |
Same here. @emotion/styled works perfectly in Pages but not the case in App |
@wenzhen-gong I had this error when I started adding i18n. There were no problems when adding chakra-ui |
What is the improvement or update you wish to see?
I am getting this error in my project, after updating each and every file with "use client" still exists
at eval (webpack-internal:///(rsc)/./node_modules/next/dist/shared/lib/router-context.js:13:38)
at (rsc)/./node_modules/next/dist/shared/lib/router-context.js (/Users/sheetalsindhu/Desktop/code/raftel/.next/server/app/page.js:2356:1)
at webpack_require (/Users/sheetalsindhu/Desktop/code/raftel/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./node_modules/next/dist/client/router.js:36:24)
at (rsc)/./node_modules/next/dist/client/router.js (/Users/sheetalsindhu/Desktop/code/raftel/.next/server/app/page.js:2004:1)
at webpack_require (/Users/sheetalsindhu/Desktop/code/raftel/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./node_modules/next/router.js:2:18)
at (rsc)/./node_modules/next/router.js (/Users/sheetalsindhu/Desktop/code/raftel/.next/server/app/page.js:2741:1)
at webpack_require (/Users/sheetalsindhu/Desktop/code/raftel/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./node_modules/next-redux-wrapper/lib/index.js:177:16) {
name: 'TypeError',
digest: undefined
}
Is there any context that might help us understand?
"next": "13.4.13",
"react": "^18.2.0",
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/messages/context-in-server-component
The text was updated successfully, but these errors were encountered: