Cast to ObjectId failed for value “profile” (type string) at path “_id” for model “User”

  • Post author:
  • Post category:
  • Post comments:0 Comments

you need to move /profile function above /:id function in userRoutes.js. I mean move: [apcode language="jscript"]userRouter.put("/profile",isAuth, ...[/apcode] above [apcode language="jscript"] userRouter.put( "/:id",isAuth,isAdmin, ...[/apcode] like this: https://github.com/basir/mern-amazona/blob/master/backend/routes/userRoutes.js#L33

Continue ReadingCast to ObjectId failed for value “profile” (type string) at path “_id” for model “User”

Hydration failed because the initial UI does not match what was rendered on the server

  • Post author:
  • Post category:
  • Post comments:0 Comments

hello there, for Hydration fail error I update the cart link in the header menu on the client-side only using this code: https://github.com/basir/next-tailwind-amazona/blob/main/components/Layout.js#L19 Also check these solutions: https://github.com/vercel/next.js/discussions/35773 also this…

Continue ReadingHydration failed because the initial UI does not match what was rendered on the server