env vars in prisma db seed (prisma/seed.ts)
What's the easiest way to use env vars from
I tried
src/env.mjs in this prisma/seed.ts file?I tried
import { env } from '../src/env.mjs' but got this errorError [ERR_REQUIRE_ESM]: require() of ES Module /app/src/env.mjs not supported.
Instead change the require of /app/src/env.mjs to a dynamic import() which is available in all CommonJS modules.
An error occurred while running the seed command:
Error: Command failed with exit code 1: ts-node --compiler-options {"module":"CommonJS"} prisma/seed.ts