Start not loading environment variables from .env.*
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.1k
- Forks
- 1.9k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 143
Description
Which project does this relate to?
Start
Describe the bug
Environment variables from .env.development aren't being loaded and merged with .env.
This might be related to #5217.
Your Example Website or App
https://github.com/Benjamin-Lee/tanstack-start-env
Steps to Reproduce the Bug or Issue
- Clone the repo and install dependencies
- Run
npm run devorbun run dev(don't runbun --bun run devsince that uses Bun's environment loader) - Take a look at localhost:3000
Expected behavior
On localhost, we'd expect to see:
SECRET: foo
EXAMPLE: bar
Screenshots or Videos
Platform
- Router / Start Version: 1.140.0
- OS: macOS
- Browser: N/A
- Browser Version: N/A
- Bundler: vite
- Bundler Version: 7.2.7
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue from the linked example by installing dependencies and running npm run dev or bun run dev, then compare the values loaded from .env and .env.development at localhost:3000. Locate the Start environment-loading entry point and add coverage for merging .env.* variables; done means the example displays SECRET: foo and EXAMPLE: bar.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vite
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100