#How to include .env files into executables ?

1 messages · Page 1 of 1 (latest)

proud minnow
#

It seems when I create a executable of a dummy index.ts using .env file it creates the executable.
But when running it I got errors like "ERR_INVALID_ARG_VALUE" in a case where Bun.env.VAR was passed to a function.

Is that supported ? How would you do that normally ? Are there docs or examples on that ?

rustic badger
#

it used to be done by default? then someone reported and it stopped being done

proud minnow
# rustic badger it used to be done by default? then someone reported and it stopped being done

I couldn't find any parameter for that in the docs.

This is a quite basic need for the feature of building executables.

Probably you mean this issue here: https://github.com/oven-sh/bun/issues/4444

At least there is a workaround: passing the environment variables at the command line instead, e.g.:
FOO=BAR myexecutable

GitHub

What version of Bun is running? 0.8.1+16b4bf341acc0f4804f0b6bdf5298c180cd00366 What platform is your computer? Darwin 23.0.0 arm64 arm What steps can reproduce the bug? Environment variables loaded...