Hi, I'm using `prisma db seed` in a Docker contain...
# orm-help
c
Hi, I'm using
prisma db seed
in a Docker container with
seed.ts
.
ts-node
is unable to resolve paths. Any ideas?
Copy code
P> prisma db seed --preview-feature

Prisma schema loaded from prisma/schema.prisma
Running seed: ts-node --project ./tsconfig.json -T "prisma/seed.ts" ...
Error: Cannot find module 'src/prisma.client'
Require stack:
- /app/prisma/seed.ts
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:927:15)
    at Function.Module._resolveFilename (/app/node_modules/tsconfig-paths/lib/register.js:75:40)
    at Function.Module._load (node:internal/modules/cjs/loader:772:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/app/prisma/seed.ts:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Module.m._compile (/app/node_modules/ts-node/src/index.ts:1295:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
    at Object.require.extensions.<computed> [as .ts] (/app/node_modules/ts-node/src/index.ts:1298:12)
Error: Command failed with exit code 1: ts-node --project ./tsconfig.json -T "prisma/seed.ts"
1
r
@Carlos Gomez 👋 Could you share your setup? I would like to test this.
c
@Ryan it was a simple issue. Locally, this worked fine. But in my Docker container, the command was failing because these source files (
src/prisma.client
and others) weren't on the filesystem. I have copied the files over to my Docker image and it's working now.
💯 1
👍 1