Error: Env vars from ${X(l)} overwrite the ones from ${X(a)}
Using Bun and Hono to run a server, don't quite know where this error is coming from.
38 Replies
Project ID:
87a3785e-2be1-460c-b4a3-11c8952b90ec
87a3785e-2be1-460c-b4a3-11c8952b90ec
please include more information, where are you seeing this error? what have you tried to do to fix this? etc etc
seeing this error after deploy is finished; prisma generates it's client and hono starts up the server. it crashes right after. i really don't know where this is coming from otherwise i would try to provide more information
^index.ts file
have you simply tried googling that error? as it's not an error that would strictly be related to the platform
yup tried googling it, but didn't return anything helpful. also the code runs the server locally
what version of bun do you use locally?
1.1.9
what version of bun is railway using?
i didn't specify a version for bun in config, is there an easy way to find out what version it's using?
print the version in code
before the error happens
ah gotcha, one sec
looks like Bun 1.1.8
i can try downgrade local version and see what happens but don't think that one minor version change would've caused this
I don't think so either
can you send that error as a message, I'm on mobile and I can't copy the form title apparently
Env vars from ${X(l)} overwrite the ones from ${X(a)}
do you have a .env file in your repo?
yes but it's not pushed
ie, it's only local
what do you run to start your app locally?
bun index.ts
running locally with no issues
what version of node do you have installed locally?
but i believe bun uses it's own runtime
well can't hurt to run node 18 and bun 1.1.8 locally and see what happens
trying to figure out how to downgrade bun, but node downgrade and it still works
nvm makes that quite easy
Solution
have you tried writing a simple Dockerfile for Railway to use?
bun 118 and node 18 still runs locally
i have not, what should i put in the docker file?
ie, downgrading doesn't seem to be doing the trick
I unfortunately don't have a bun dockerfile on hand, but there would be many great examples online, once you see one you will know how to use or modify them to your needs
right, i'm just trying to figure out the motivation on the bun dockerfile :- i'm not doing anything special with bun, the env error seems to be (i could be totally wrong) from a conflict with how railway is injecting env and how bun is expecting it; unsure what part of dockerfile to modify to change that conflict
Railway doesn't do anything special they are just environment variables, I think this is something nixpacks is doing wrong and a Dockerfile would answer that question
just to close this out, couldnt' figure it out with bun so just reverted to hosting with traditional node
did you get to try a dockerfile?
marking that as solved since another use had the same issue and a Dockerfile solved it for them.