Time
Time3mo ago

Getting strange react error in nextjs

I am getting a strange Error Message when nextjs tries to compile:
TypeError: react__WEBPACK_IMPORTED_MODULE_1__.useContext is not a function
at Config (./src/components/developer/config.tsx:13:80)
at stringify (<anonymous>)
at stringify (<anonymous>)
at AsyncLocalStorage.run (node:async_hooks:346:14)
digest: "1302885403"
TypeError: react__WEBPACK_IMPORTED_MODULE_1__.useContext is not a function
at Config (./src/components/developer/config.tsx:13:80)
at stringify (<anonymous>)
at stringify (<anonymous>)
at AsyncLocalStorage.run (node:async_hooks:346:14)
digest: "1302885403"
it happends if i try:
const roles = trpc.snowflake.roles.useQuery();
const roles = trpc.snowflake.roles.useQuery();
the error message in browser is:
No description
2 Replies
Time
Time3mo ago
Fossil
Fossil3mo ago
Is Config a server component? Make sure you're declaring "use client" at the top