Hello, team! I’m very excited to join the communit...
# developers
t
Hello, team! I’m very excited to join the community. I have a question for setting up the development environment. I followed the instruction here: https://github.com/calcom/cal.com#development: copied the
.env
files and ran
yarn dx
, but I got:
Copy code
@calcom/web:dx:     '  error: Environment variable not found: DATABASE_URL.\n' +
@calcom/web:dx:     '  -->  schema.prisma:6\n' +
@calcom/web:dx:     '   | \n' +
@calcom/web:dx:     ' 5 |   provider = "postgresql"\n' +
@calcom/web:dx:     ' 6 |   url      = env("DATABASE_URL")\n' +
@calcom/web:dx:     '   | \n' +
@calcom/web:dx:     '\n' +
This error is gone if I add
DATABASE_URL
to
apps/web/.env
. Am I (or the docs) missing anything? 🤔
p
@zomars
👍 1
a
I needed to add db url myself to root env too
I think yarn dx gives preference to root
Can you try adding to root .env ?
👀 1
t
Just tried adding
DATABASE_URL
to root
.env
, doesn’t work for me. Same error
a
and in apps/web ? Sorry !
t
No worries, apps/web works, which is what I would expect. Should I raise a small PR to add it back in
apps/web/.env.example
? I wonder what is the reason behind putting it in
packages/prisma
🤔
a
@Thang Vu Thank you Thang 😃, lets ping @zomars which is leading the monorepo transition, I think we had good reason to have it in prisma package, but we need to make sure that .env is correctly passed from the package to other packages requiring it
👍 1
t
My bad, it seems like the env is required in both
packages/prisma
and
apps/web
. Without it,
packages/prisma
would fail its own Prisma commands
❤️ 1
a
Regardless we might need to either fix that or be more explicit about it in the docs/README/env files itself, thanks for reporting Thang
t
Happy to help, @Agusti 😄
❤️ 1
z
The env variables is taken from the directory where the command is being called from
👍 2
That’s why we should try to run everything from root
❤️ 1
And I only set the variable on prisma/.env
a
Btw I think we can explicitly allow some env vars in next.config if we want to so they don't need to be explicitly PUBLIC
z
Yeah, but we're trying to avoid that and also we like the public variables should be explicit
t