Skip to content

undefined process.env.ORGANIZATIONS_SVC_URL and process.env.ORGANIZATIONS_SVC_PORT #58

Description

@freeart

organization-svc.options contains undefined process.env.XXX variables because ConfigModule.forRoot() runs after this file (organization-svc.options.ts) will be injected

import { OrganizationsModule } from './organizations/organizations.module'

@Module({
  imports: [
    ConfigModule.forRoot(),
    OrganizationsModule
  ]
})

It works in docker only because you defined env variables before the process starts

ConfigModule.forRoot() has to be called before all imports to read real data from .env file

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions