I am working on a project in which I have created a login dialog but I am getting an error which I am not able to solve, what is it I have given in the above photo and request you to answer it somehow.
`- error node_modules/@clerk/shared/dist/esm/hooks/createContextAndHook.js (4:0) @ assertContextExists
- error Error: ClerkInstanceContext not found
null`
ERROR:
`
Unhandled Runtime Error
Error: ClerkInstanceContext not found
Call Stack
assertContextExists
node_modules/@clerk/shared/dist/esm/hooks/createContextAndHook.js (4:0)
useCtx
node_modules/@clerk/shared/dist/esm/hooks/createContextAndHook.js (13:0)
HOC
node_modules/@clerk/clerk-react/dist/esm/components/withClerk.js (10:43)
renderWithHooks
node_modules/next/dist/compiled/react-dom/cjs/react-dom.development.js (10697:0)
updateFunctionComponent
node_modules/next/dist/compiled/react-dom/cjs/react-dom.development.js (15180:0)
mountLazyComponent
node_modules/next/dist/compiled/react-dom/cjs/react-dom.development.js (15620:0)
beginWork$1
node_modules/next/dist/compiled/react-dom/cjs/react-dom.development.js (17316:0)
beginWork
node_modules/next/dist/compiled/react-dom/cjs/react-dom.development.js (25689:0)
performUnitOfWork
node_modules/next/dist/compiled/react-dom/cjs/react-dom.development.js (24540:0)
workLoopSync
node_modules/next/dist/compiled/react-dom/cjs/react-dom.development.js (24256:0)
renderRootSync
node_modules/next/dist/compiled/react-dom/cjs/react-dom.development.js (24211:0)
recoverFromConcurrentError
node_modules/next/dist/compiled/react-dom/cjs/react-dom.development.js (23446:0)
performConcurrentWorkOnRoot
node_modules/next/dist/compiled/react-dom/cjs/react-dom.development.js (23352:0)
workLoop
node_modules/next/dist/compiled/scheduler/cjs/scheduler.development.js (261:0)
flushWork
node_modules/next/dist/compiled/scheduler/cjs/scheduler.development.js (230:0)
MessagePort.performWorkUntilDeadline
node_modules/next/dist/compiled/scheduler/cjs/scheduler.development.js (537:0)`
I need to fix the problem on that home page and give it core as per arrangement
2
Answers
I have been facing the same issue.
your app/auth/layout.tsx and app/root/layout.tsx should be wrapped with ClerkProvider.
This fixed my issue I Hope it helps.
It Really helped me to solve me the same issue. Thank You.