Next.js Course part-2 Issue Tracker : Assigned issue to users

Next.js Course part-2 Issue Tracker : Assigned issue to users.

I restarted the server but this problem still occurs

1 Like

Im facing the same issue. Did you find the solution somehow?

I found out the solution. Just replace localhost database with database from production - Planet Scale - and everything will be working :slight_smile:

I’ve got the same issue. restarting dev server, vs code and Windows didn’t help.

Unless I’m missing somehting, suggested solution above sounds more a work-around rather than an actual fix. I’m using Railway for Dev/Prod databases and still hitting this issue.

curiously I’ve just noticed that if I manually populate the assignedUserID field in the database, and then Postman patch the title, the returned result doesn’t include the assignedUserId :\

if I Postman patch a empty string I get the expected Min(1) error from Zod, so it’s making it that far.

Re-ran ‘prisma migrate dev’ and it returns 'Already in sync". Checking the migrations folder and the sql looks correct. So individually api code and database look correct.

It seems like Prisma hasn’t recognised the new Feild correctly when migrating…

Tried to force a reSync by renaming the DB assignedUser Feild to ‘aUId’ and got this on ‘prisma migrate dev’

Now wondering if this could be the issue (pun not intended) …

1 Like

So in my case the solution was a combo. only some may apply to your case(s):

  1. Check you package.json for ‘@prisma/client’. If you have this you’ve probably done an oopsie earlier in the project.
  2. npm uninstall @prisma/client
  3. npm uninstall prisma
  4. npm install prisma@5.3.1
  5. Close VS Code
  6. Go to your folder directory in your OS file browser. Delete ‘node_modules’ folder
  7. Reopen Project in VS Code
  8. npm i
  9. npm run dev
  10. Retry Postman Patch assignedToUserId step. Hopefully it works for you now.
2 Likes

I had that same issue. I didn’t realize until much later that I also had that EPERM message. I removed the models added in that lesson, ran npx prisma migrate dev, added those models, and reran npx prisma migrate dev. It’s been okay after that.

This solution worked for me. Thanks

This works smoothly
Thank you