Bun ignores `--dotenv` option
Opened this issue · 1 comments
ahas commented
Environment
- Operating System: Linux
- Node Version: v18.17.1
- Nuxt Version: 3.8.2
- CLI Version: 3.10.0
- Nitro Version: 2.8.0
- Package Manager: bun@1.0.14
- Builder: -
- User Config: devtools, app
- Runtime Modules: -
- Build Modules: -
Reproduction
- Create multiple
.env
files:.env.local
,.env.dev
,.env.prod
. - Add
--dotenv .env.dev
to the dev command inpackage.json
>scripts
.
For example:"dev": "nuxt dev --dotenv .env.dev"
Even if executed withbunx nuxt dev --dotenv .env.dev
, the result is the same. - Write code that utilizes values from the
.env.dev
file, execute thedev
command, and check the result.
Describe the bug
When running Nuxt with Bun, the --dotenv
option does not work as specified.
If both .env.local
and .env.dev
files are created, it seems that the .env.local
file is read with priority.
Additional context
No response
Logs
No response
danielroe commented
This is likely due to a Bun-specific behaviour rather than Nuxt.