#Error with createContext in Next.js TypeScript Project (SOLVED)

7 messages · Page 1 of 1 (latest)

tranquil forge
#

Hi everyone,

I'm encountering an issue in my Next.js TypeScript project and could use some help. Here are the details:

Error Message:

(0 , reactWEBPACK_IMPORTED_MODULE_0.createContext) is not a function

File Structure:

rsc/./app/Provider.tsx
file:///E:/SummerProjects/dynamic_docs/dynamic_docs/.next/server/app/(root)/page.js (216:1)

(Note: There is a page.tsx file, not page.js)

robust plover
#

In collaborativeroom page add ' use client ' on the top.. And this will get resloved.

tranquil forge
tranquil forge
#

Error with createContext in Next.js TypeScript Project (SOLVED)

#

Error: TypeError when trying to create a blank document with Editor.

Solution:

Use @liveblocks/react instead of @liveblocks/react/suspense.
Add "use client" at the top of the CollaborativeRoom.tsx file.
Add "use client" at the top of the Provider.tsx file.

quartz kayak
#

Then you can give us your repo and we will help you check it

tranquil forge