I am trying to setup my google calendar API. And a...
# developers
v
I am trying to setup my google calendar API. And after I run this yarn command :
Copy code
yarn seed-app-store
This following error is coming:
Copy code
PrismaClientInitializationError:
Invalid `prisma.app.upsert()` invocation in
/Users/NoobDev/Documents/open-source/cal.com/packages/prisma/seed-app-store.ts:160:20

  157   keys?: Prisma.AppCreateInput["keys"],
  158   isTemplate?: boolean
  159 ) {
→ 160   await prisma.app.upsert(
error: Environment variable not found: DATABASE_URL.
  -->  schema.prisma:6
   |
 5 |   provider = "postgresql"
 6 |   url      = env("DATABASE_URL")
   |

Validation Error Count: 1
    at Zr.handleRequestError (/Users/NoobDev/Documents/open-source/cal.com/node_modules/@prisma/client/runtime/library.js:171:6688)
    at Zr.handleAndLogRequestError (/Users/NoobDev/Documents/open-source/cal.com/node_modules/@prisma/client/runtime/library.js:171:5948)
    at /Users/NoobDev/Documents/open-source/cal.com/node_modules/@prisma/client/runtime/library.js:174:3087
    at async /Users/NoobDev/Documents/open-source/cal.com/node_modules/@prisma/client/runtime/library.js:174:3268
    at async t._executeRequest (/Users/NoobDev/Documents/open-source/cal.com/node_modules/@prisma/client/runtime/library.js:174:10726)
    at async t._request (/Users/NoobDev/Documents/open-source/cal.com/node_modules/@prisma/client/runtime/library.js:174:10455)
    at async createApp (/Users/NoobDev/Documents/open-source/cal.com/packages/prisma/seed-app-store.ts:160:3)
    at async main (/Users/NoobDev/Documents/open-source/cal.com/packages/prisma/seed-app-store.ts:174:3) {
  clientVersion: '4.11.0',
  errorCode: undefined
}
ok so I resolved this issue. Happened all because of the misleading README. It seems like we need to have
GOOGLE_API_CREDENTIALS
in
.env.appStore
and not in
.env
. Also we need to have
DATABASE_URL
in both
.env
and
.env.appStore
also which is weird. My question is why can’t we just import
.env
import in
seed-app-store.ts
rather than using
DATABASE_URL
in two env files.