Skip to content

Does not load env vars from .env #908

@dobesv

Description

@dobesv

When I try to configure the backfill cache by creating a .env file in the parent folder of my project, it did not use the cache. If I set the environment variables on the command line, it does use the cache. From this I infer that it is not loading the .env file, even though the documentation seems to imply that it should be doing this automatically

It looks like .env is only loaded if you import the backfill package, but lage does not do this (any more?). I guess at some point lage changed to bypass the main backfill package and lost the .env loading logic.

The .env loading is referenced on this page:

https://microsoft.github.io/lage/docs/guides/remote-cache

Either the .env loading logic should be restored or the docs should be updated not to say that .env will be loaded automatically.

Workaround

You can update lage.config.cjs to use a dotenv library to load the .env yourself. For example by adding dotenv-mono as a dependency and running require('dotenv-mono').load();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions