TanStack / TanStack/router

Start not loading environment variables from .env.*

Open
#6,052 6 comments 8 reactions 0 assignees View on GitHub

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
  1. Clone the repo and install dependencies
  2. Run npm run dev or bun run dev (don't run bun --bun run dev since that uses Bun's environment loader)
  3. Take a look at localhost:3000
Expected behavior

On localhost, we'd expect to see:

SECRET: foo
EXAMPLE: bar
Screenshots or Videos
Image
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.