router icon indicating copy to clipboard operation
router copied to clipboard

Start not loading environment variables from .env.*

Open Benjamin-Lee opened this issue 1 month ago โ€ข 1 comments

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

Benjamin-Lee avatar Dec 09 '25 14:12 Benjamin-Lee

๐Ÿ“ CodeRabbit Plan Mode

Generate an implementation plan and agent prompts for this issue.

  • [ ] Create Plan
Examples

๐Ÿ”— Similar & Duplicate Issues

Possible Duplicates

Related Issues

๐Ÿ”— Related PRs

TanStack/router#5334 - docs: fix Bun server environment variable names and improve clarity [merged] TanStack/router#5735 - examples:start-clerk-basic fixed .env [merged]

๐Ÿ‘ค Suggested Assignees

  • AlexanderHott
  • ryanagillie
  • magnusmay
  • devanfarrell

๐Ÿงช Issue enrichment is currently in early access.

To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

issue_enrichment:
  auto_enrich:
    enabled: false

coderabbitai[bot] avatar Dec 09 '25 14:12 coderabbitai[bot]