Skip to content

Environment file issue with 'create' command #6

@jali5859

Description

@jali5859

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions