Error: Env vars from ${X(l)} overwrite the ones from ${X(a)}
spacemandev-git
PROOP

2 years ago

Using Bun and Hono to run a server, don't quite know where this error is coming from.

42 Replies

spacemandev-git
PROOP

2 years ago

87a3785e-2be1-460c-b4a3-11c8952b90ec


brody
EMPLOYEE

2 years ago

please include more information, where are you seeing this error? what have you tried to do to fix this? etc etc


spacemandev-git
PROOP

2 years ago

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


spacemandev-git
PROOP

2 years ago

1242833299412488200


spacemandev-git
PROOP

2 years ago

^index.ts file


brody
EMPLOYEE

2 years ago

have you simply tried googling that error? as it's not an error that would strictly be related to the platform


spacemandev-git
PROOP

2 years ago

yup tried googling it, but didn't return anything helpful. also the code runs the server locally


brody
EMPLOYEE

2 years ago

what version of bun do you use locally?


spacemandev-git
PROOP

2 years ago

1.1.9


brody
EMPLOYEE

2 years ago

what version of bun is railway using?


spacemandev-git
PROOP

2 years ago

i didn't specify a version for bun in config, is there an easy way to find out what version it's using?

1242834267596132400


brody
EMPLOYEE

2 years ago

print the version in code


brody
EMPLOYEE

2 years ago

before the error happens


spacemandev-git
PROOP

2 years ago

ah gotcha, one sec


spacemandev-git
PROOP

2 years ago

looks like Bun 1.1.8

1242835900468039700


spacemandev-git
PROOP

2 years ago

i can try downgrade local version and see what happens but don't think that one minor version change would've caused this


brody
EMPLOYEE

2 years ago

I don't think so either


brody
EMPLOYEE

2 years ago

can you send that error as a message, I'm on mobile and I can't copy the form title apparently


spacemandev-git
PROOP

2 years ago

Env vars from ${X(l)} overwrite the ones from ${X(a)}


brody
EMPLOYEE

2 years ago

do you have a .env file in your repo?


spacemandev-git
PROOP

2 years ago

yes but it's not pushed


spacemandev-git
PROOP

2 years ago

ie, it's only local


brody
EMPLOYEE

2 years ago

what do you run to start your app locally?


spacemandev-git
PROOP

2 years ago

bun index.ts


spacemandev-git
PROOP

2 years ago

running locally with no issues

1242836793284628500


brody
EMPLOYEE

2 years ago

what version of node do you have installed locally?


spacemandev-git
PROOP

2 years ago

but i believe bun uses it's own runtime

1242837349348413400


brody
EMPLOYEE

2 years ago

well can't hurt to run node 18 and bun 1.1.8 locally and see what happens


spacemandev-git
PROOP

2 years ago

1242837753348227000


spacemandev-git
PROOP

2 years ago

trying to figure out how to downgrade bun, but node downgrade and it still works


brody
EMPLOYEE

2 years ago

nvm makes that quite easy


spacemandev-git
PROOP

2 years ago

1242838118743150600


brody
EMPLOYEE

2 years ago

have you tried writing a simple Dockerfile for Railway to use?


spacemandev-git
PROOP

2 years ago

bun 118 and node 18 still runs locally


spacemandev-git
PROOP

2 years ago

i have not, what should i put in the docker file?


spacemandev-git
PROOP

2 years ago

ie, downgrading doesn't seem to be doing the trick


brody
EMPLOYEE

2 years ago

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


spacemandev-git
PROOP

2 years ago

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


brody
EMPLOYEE

2 years ago

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


spacemandev-git
PROOP

2 years ago

just to close this out, couldnt' figure it out with bun so just reverted to hosting with traditional node


brody
EMPLOYEE

2 years ago

did you get to try a dockerfile?


brody
EMPLOYEE

2 years ago

marking that as solved since another use had the same issue and a Dockerfile solved it for them.


Loading...