Skip to content

public env variables are not loaded on client through import.meta.env #3078

@sbeben

Description

@sbeben

Description

when i console.log import.meta.env i get

    {
        "BASE_ASSETS": "/",
        "BASE_SERVER": "/",
        "BASE_URL": "/",
        "DEV": false,
        "MODE": "production",
        "PROD": true,
        "SSR": false
    }

although there are some PUBLIC_ENV__ variables inside .env

steps to reproduce:
-clone repo with reproduction
-add .env file and some public env into it
-run pnpm i, pnpm run build and pnpm start
-go to main page and see the log (the console.log is inside useEffect hook of a react page, so it is 100% runs on client side)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions