Closed kdaviduik closed 7 months ago
Try deleting the playground directory and setting it over again.
I'm afraid this workshop is tricky with all the database changes
Thank you! I just tried that and got the same error. I then tried using the schema.prisma
and seed.ts
from the solution diff, same error.
Both of these files are within the prisma
directory:
I am running npx prisma db push
(which succeeds) followed by npx tsx ./prisma/seed.ts
Hi @kdaviduik!
I'm sorry you're having this trouble. I just tried it myself and did not have any errors.
From the look of the error, it's actually coming from tsx
which is basically like running node
, but it supports running ts files. So it seems there may be some issue with your version of node or your system when you run that package. I dove into the spot where that error is happening and it's on this statement: const[e]=n.errors;
So my guess is there was some kind of error, and when tsx
was trying to give you a friendly error message it failed because n.errors
(whatever that is) is undefined and therefore can't be destructured.
If you're feeling brave, you could go into that file at that location and add console.log(errors);
right before const[e]=n.errors;
and maybe that'll give you more information.
Alternatively, you could just change the file from seed.ts
to seed.js
for this exercise and run that with node
.
Unfortunately I'm guessing you'll have the same problem any time you want to run the seed script and I do think there will be some typescript syntax in future exercises.
If you'd like to come to my office hours sometime, then we can pair on it together to figure out what's going on. Otherwise, I'm afraid there's not much more I can do to help you troubleshoot what's going on with your setup. Sorry!
While following the steps in this problem, whenever I run
npx tsx ./prisma/seed.ts
I get this error:I have pulled the latest changes for this repo and restarted everything, and my database consists of a note and a user (as set up in the previous exercises).