adrianhajdin / collaborative-editor

Learn how to build any collaborative application by building LiveDocs, an improved Google Docs that manages millions of collaborators in real-time.
https://jsm-live-docs.vercel.app
303 stars 78 forks source link

TypeError: Cannot read properties of undefined (reading 'resolveMentionSuggestions') #9

Open Madhannmady07 opened 1 month ago

Madhannmady07 commented 1 month ago

At the timestamp of 1:58:38, the editor part that is the place where we edit our doc is available for the instructor, but whereas in my case i wasnt able to get that righly instead of that i was thrown with an error saying , TypeError: Cannot read properties of undefined (reading 'resolveMentionSuggestions')

help me to resolve this error .

Screenshot 2024-07-27 100243

omkarpawar7000 commented 1 month ago

Just delete the node modules and install them again. Also make sure that all liveblocks dependencies in package.json should be of same version. It will fix the issue.

Madhannmady07 commented 1 month ago

I have done what u told , but still the error is not rectified sadly

is there anything which causes this problem >? or should i do anyother to solve this problem ?

omkarpawar7000 commented 1 month ago

try copying and pasting the package.json file of this repo and then run npm install

Madhannmady07 commented 1 month ago

since i copy paste the pacakge.json code , it shows me with this error `Conflicts:

earlier i had 2.4.0 version , now i changed to 2.3.0

still the resolveMentionSuggestions is there along with this

omkarpawar7000 commented 1 month ago

i had the same error. the last thing i did is that i cloned this repo and replaced my env.local file with my secret key and auth keys

Madhannmady07 commented 1 month ago

i had the same error. the last thing i did is that i cloned this repo and replaced my env.local file with my secret key and auth keys

bruh , are u serious ? i think u are making fun out of me ? u may not even got this error, but for funny sake u are saying this ig.

Madhannmady07 commented 1 month ago

now at last, i got this error Clerk - DEPRECATION WARNING: "clerkClient singleton" is deprecated and will be removed in the next major release. UseclerkClient()as a function instead. , this will solve the problem ig .

but idk how to clear this.

omkarpawar7000 commented 1 month ago

bro i told you to clone becoz the peer dependencies will be installed as in the original repo of video just like the instructor did and the packages required will be installed same as that required for the project

omkarpawar7000 commented 1 month ago

now at last, i got this error Clerk - DEPRECATION WARNING: "clerkClient singleton" is deprecated and will be removed in the next major release. UseclerkClient()as a function instead. , this will solve the problem ig .

but idk how to clear this.

this will remain the same you can run npm ls to check the liveblocks versions if they are same or not

omkarpawar7000 commented 1 month ago

image

see this my one is running well now

barbaldo commented 1 month ago

I also got this error, my liveblocks related dependancies are


    "@liveblocks/react": "^2.4.0",
    "@liveblocks/react-lexical": "^2.0.3",
    "@liveblocks/react-ui": "^2.4.0",
    "@liveblocks/yjs": "^2.0.3",
yunsoShin commented 1 month ago

I also got this error, my liveblocks related dependancies are

    "@liveblocks/react": "^2.4.0",
    "@liveblocks/react-lexical": "^2.0.3",
    "@liveblocks/react-ui": "^2.4.0",
    "@liveblocks/yjs": "^2.0.3",

@username

Looking at your package list, the important package is set to 2.4.0. The correct version is 2.3.0

This issue seems to be related to the version of the dependency packages. Please try removing the existing dependencies and reinstalling the correct versions as follows:

  1. Copy and paste the content of the package.json file from the collaborative-editor directory:

    {
      "dependencies": {
        "@liveblocks/client": "^2.3.0",
        "@liveblocks/node": "^2.3.0",
        "@liveblocks/react": "^2.3.0",
        "@liveblocks/react-lexical": "^2.3.0",
        "@liveblocks/react-ui": "^2.3.0"
      }
    }
  2. Remove the node_modules folder and package-lock.json file:

    rm -rf node_modules package-lock.json
  3. Install the correct versions of the dependencies:

    npm install

If the dependencies continue to install version 2.4.0, forcibly install version 2.3.0 as follows:

    npm install @liveblocks/client@2.3.0 @liveblocks/node@2.3.0 @liveblocks/react@2.3.0 @liveblocks/react-lexical@2.3.0 @liveblocks/react-ui@2.3.0

Updating the dependencies with the above versions should resolve the issue. Please try reinstalling with these versions.

omkarpawar7000 commented 1 month ago

Exactly i had did the same too. My one got resolved during the first attempt when i was writing the code.