Prisma Seeding

Hello, I am trying to seed my database (supabase) using the 'npx prisma db seed' command. However I keep getting this error: Running seed command ts-node --compiler-options {"module":"CommonJS"} prisma/seed.ts ... TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/folders/project_climb/prisma/seed.ts. I am using the T3 stacks so I have my script written "prisma": { "seed": "ts-node --compiler-options {"module":"CommonJS"} prisma/seed.ts" }, according to the Prisma Docs. Here is my package.json: { "name": "project_climb", "version": "0.1.0", "type": "module", "private": true, "scripts": { "build": "next build", "dev": "next dev", "postinstall": "prisma generate", "lint": "next lint", "start": "next start", "test": "jest", "db-start": "npx supabase start", "db-stop": "npx supabase stop" }, "prisma": { "seed": "ts-node --compiler-options {"module":"CommonJS"} prisma/seed.ts" }, "dependencies": { "@next-auth/prisma-adapter": "^1.0.7", "@prisma/client": "^5.1.1", "@radix-ui/react-slot": "^1.0.2", "@supabase/supabase-js": "^2.33.2", "@t3-oss/env-nextjs": "^0.6.0", "@tanstack/react-query": "^4.29.25", "@trpc/client": "^10.34.0", "@trpc/next": "^10.34.0", "@trpc/react-query": "^10.34.0", "@trpc/server": "^10.34.0", (... cut down for the word count max) }, "devDependencies": { "@types/eslint": "^8.44.2", "@types/node": "^18.17.17", "@types/react": "^18.2.20", "@types/react-dom": "^18.2.7", "@typescript-eslint/eslint-plugin": "^6.3.0", "@typescript-eslint/parser": "^6.3.0", "prisma": "^5.3.1", "supabase": "^1.93.0" "ts-node": "^10.9.1", "typescript": "^5.2.2" }, "ct3aMetadata": { "initVersion": "7.19.0" } }
3 Replies
CsarChvz
CsarChvz10mo ago
did u fixed? same problem
Wiznet
Wiznet10mo ago
download and use npx to run it. Should be some so threads about it
Leonidas
Leonidas10mo ago
Try „npx tsx prisma/seed.ts“ Tsx is a typescript runner just like ts-node, but doesnt make your life a headache due to good defaults
Want results from more Discord servers?
Add your server