Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment file issue with 'create' command #6

Open
jali5859 opened this issue Aug 5, 2024 · 0 comments
Open

Environment file issue with 'create' command #6

jali5859 opened this issue Aug 5, 2024 · 0 comments

Comments

@jali5859
Copy link

jali5859 commented Aug 5, 2024

Package Manager:
NPM

Plugin:
@adminjs/express

Adapter:
@adminjs/sql

Database Driver:
MySQL

OS:
MacOS Sonoma 14.5

After setting up the environment variables from the CLI, the .env file was created with the correct variables. After building and running i kept getting the following error:

Screenshot 2024-08-05 at 5 08 14 PM

This suggested that the .env file credentials were not being accessed correctly.

I had to make some small modifications to the src/app.ts file:

Screenshot 2024-08-05 at 5 11 53 PM

src/config.ts:

Screenshot 2024-08-05 at 5 12 49 PM

I also installed the dotenv package.

After making these changes, building and running, the app worked well.

Just thought i'd let you guys know about this issue i faced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant