mirror of
https://github.com/Mintplex-Labs/vector-admin.git
synced 2026-07-18 18:14:31 -04:00
Environment variable not found: DATABASE_CONNECTION_STRING. #60
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:setupEnvironment
@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:migratein order to run theyarn prisma:setupcommand successfully:If this is an issue that has to be solved, I am ready to work on it.
@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)
@kh-ac commented on GitHub (Jan 8, 2024):
Yes, after running
yarn dev:setupscript 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 :

@timothycarambat commented on GitHub (Jan 9, 2024):
You are correct, i updated the
dev:setupto create both files now or else it is totally unclear that thatbackend/.envis required. Of course, the user still needs to update the connection string to be correct, but it is less ambiguous now and theprismacommands will use that connection in thebackend/.envnow.