Skip to content

V21 Angular builder does not fetch .env variables #32760

@atarakanov-web

Description

@atarakanov-web

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Why new vite builder do not parse .env file?

After add dotenv-cli vite builder work correctly on Windows 10

Image

Minimal Reproduction

ng serve / ng build

Exception or Error


Your Environment

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build            │ 21.1.4            │ ^21.1.4           │
│ @angular/cdk              │ 21.1.5            │ ^21.1.5           │
│ @angular/cli              │ 21.1.4            │ ^21.1.4           │
│ @angular/common           │ 21.1.5            │ ^21.1.0           │
│ @angular/compiler         │ 21.1.5            │ ^21.1.0           │
│ @angular/compiler-cli     │ 21.1.5            │ ^21.1.0           │
│ @angular/core             │ 21.1.5            │ ^21.1.0           │
│ @angular/forms            │ 21.1.5            │ ^21.1.0           │
│ @angular/platform-browser │ 21.1.5            │ ^21.1.0           │
│ @angular/router           │ 21.1.5            │ ^21.1.0           │
│ rxjs                      │ 7.8.2             │ ~7.8.0            │
│ typescript                │ 5.9.3             │ ~5.9.2            │
│ vitest                    │ 4.0.18            │ ^4.0.8            │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions