Skip to content

Env variables don't seem to load from a .env file on the new cli #767

Closed
@alexjoverm

Description

@alexjoverm

Version

3.0.0-alpha.5

Reproduction link

https://github.com/alexjoverm/vue-cli-env-reproduce

Steps to reproduce

Clone, run npm install and npm run serve on the repo provided.

What is expected?

According to the code of the Service, some env variables should be loaded taken from a path, which are parsed on the loadEnv util.

By adding some logs, it seems that indeed the path it takes when running npm run serve is ${rootDirectory}/.env.development and ${rootDirectory}/.env.development.local. They're indeed loaded.

So, by the console.log(process.env) line in the main.js file, those variables should be printed in the console.

What is actually happening?

They're not listed in the console.

Note: if this is not supposed how is it possible to add env variables?

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