Environment variable not found: DATABASE_CONNECTION_STRING. #60

Closed
opened 2026-02-15 16:29:52 -05:00 by yindo · 4 comments
Owner

Originally created by @kh-ac on GitHub (Jan 7, 2024).

Hi,
While trying to setup the project locally on my machine, I am getting this error when running the script: yarn prisma:setup
Screenshot from 2024-01-07 18-47-40

Environment

  • Operating System: Ubuntu 22.04.3 LTS
Originally created by @kh-ac on GitHub (Jan 7, 2024). Hi, While trying to setup the project locally on my machine, I am getting this error when running the script: `yarn prisma:setup` ![Screenshot from 2024-01-07 18-47-40](https://github.com/Mintplex-Labs/vector-admin/assets/93795387/ea3bfa4b-2181-4223-ab63-247d0415b906) ### Environment - Operating System: Ubuntu 22.04.3 LTS
yindo added the questionbugdocumentation labels 2026-02-15 16:29:52 -05:00
yindo closed this issue 2026-02-15 16:29:52 -05:00
Author
Owner

@kh-ac commented on GitHub (Jan 8, 2024):

@timothycarambat
I did some research and i found that Prisma read environment vars from a .env file by default and in case we want to work with multiple .env files there is a configuration that has to be done.
So I had to add the following to the prisma:migrate in order to run the yarn prisma:setup command successfully:

Screenshot from 2024-01-08 16-38-02

If this is an issue that has to be solved, I am ready to work on it.

@kh-ac commented on GitHub (Jan 8, 2024): @timothycarambat I did some research and i found that Prisma read environment vars from a .env file by default and in case we want to work with multiple .env files there is a configuration that has to be done. So I had to add the following to the `prisma:migrate` in order to run the `yarn prisma:setup` command successfully: ![Screenshot from 2024-01-08 16-38-02](https://github.com/Mintplex-Labs/vector-admin/assets/93795387/03346921-90be-4e3a-9654-8f45754e086b) If this is an issue that has to be solved, I am ready to work on it.
Author
Owner

@timothycarambat commented on GitHub (Jan 8, 2024):

This was still the case after running yarn devSetup?
https://github.com/Mintplex-Labs/vector-admin/blob/e7659c94476cb3329cb3ade9f5a49cc9915d99d3/devSetup.js#L11

Which is supposed to set up a server .env and have the variable in it (to a default string that can be modified)

@timothycarambat commented on GitHub (Jan 8, 2024): This was still the case after running `yarn devSetup`? https://github.com/Mintplex-Labs/vector-admin/blob/e7659c94476cb3329cb3ade9f5a49cc9915d99d3/devSetup.js#L11 Which is supposed to set up a server .env and have the variable in it (to a default string that can be modified)
Author
Owner

@kh-ac commented on GitHub (Jan 8, 2024):

This was still the case after running yarn devSetup?

https://github.com/Mintplex-Labs/vector-admin/blob/e7659c94476cb3329cb3ade9f5a49cc9915d99d3/devSetup.js#L11

Which is supposed to set up a server .env and have the variable in it (to a default string that can be modified)

Yes, after running yarn dev:setup script just the .env.development file is created as mentioned in here :
https://github.com/Mintplex-Labs/vector-admin/blob/e7659c94476cb3329cb3ade9f5a49cc9915d99d3/devSetup.js#L11-L16

But i think Prisma expects a .env by default not .env.something, i had to either create an .env file manually and write my environment variables or set the .env file for Prisma like that :
Screenshot from 2024-01-08 16-38-02

@kh-ac commented on GitHub (Jan 8, 2024): > This was still the case after running `yarn devSetup`? > > https://github.com/Mintplex-Labs/vector-admin/blob/e7659c94476cb3329cb3ade9f5a49cc9915d99d3/devSetup.js#L11 > > Which is supposed to set up a server .env and have the variable in it (to a default string that can be modified) Yes, after running `yarn dev:setup` script just the .env.development file is created as mentioned in here : https://github.com/Mintplex-Labs/vector-admin/blob/e7659c94476cb3329cb3ade9f5a49cc9915d99d3/devSetup.js#L11-L16 But i think Prisma expects a .env by default not .env.something, i had to either create an .env file manually and write my environment variables or set the .env file for Prisma like that : ![Screenshot from 2024-01-08 16-38-02](https://github.com/Mintplex-Labs/vector-admin/assets/93795387/01b07ac4-2782-4115-900e-834b570d40aa)
Author
Owner

@timothycarambat commented on GitHub (Jan 9, 2024):

You are correct, i updated the dev:setup to create both files now or else it is totally unclear that that backend/.env is required. Of course, the user still needs to update the connection string to be correct, but it is less ambiguous now and the prisma commands will use that connection in the backend/.env now.

@timothycarambat commented on GitHub (Jan 9, 2024): You are correct, i updated the `dev:setup` to create _both_ files now or else it is totally unclear that that `backend/.env` is required. Of course, the user still needs to update the connection string to be correct, but it is less ambiguous now and the `prisma` commands will use that connection in the `backend/.env` now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/vector-admin#60