Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does node:process.loadEnv support in bun #564

Open
qiaoborui opened this issue Aug 24, 2024 · 2 comments
Open

Does node:process.loadEnv support in bun #564

qiaoborui opened this issue Aug 24, 2024 · 2 comments

Comments

@qiaoborui
Copy link

looks like it cannot read the env file when I use the bun to run the application,
maybe because bun does not support to node:process to read envfile

@egeesenyel
Copy link

As far as I know bun has native support, the loadEnv function in bun is not needed because it should automatically load the file.

You can access the values in this way:
console.log(process.env.FOO)
console.log(Bun.env.SECRET)

So you may need to refactor the code that loads the configuration.

@qiaoborui
Copy link
Author

As far as I know bun has native support, the loadEnv function in bun is not needed because it should automatically load the file.

You can access the values in this way: console.log(process.env.FOO) console.log(Bun.env.SECRET)

So you may need to refactor the code that loads the configuration.

You're right, bun has native support for environment variables, but in this project node:process is used to read environment variables, if you use bun to run it you'll only get the empty environment variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants