Elysia undefined is not an object (evaluating 'error2.schema')
dayblox
HOBBYOP

a year ago

I have a simple Elysia server with query params type constraints.
When running on localhost, if I leave out a required param, I get the expected error in json format
When on railway (https://hunt.up.railway.app) I get
undefined is not an object (evaluating 'error2.schema')

0 Replies

dayblox
HOBBYOP

a year ago

98eb5118-41c1-49d1-bd13-071f6a9e3ee2


dayblox
HOBBYOP

a year ago

You can check out the swagger at https://hunt.up.railway.app/swagger


medim
MODERATOR

a year ago

I don't think this is related to railway… did you try a dockerized environment locally?


dayblox
HOBBYOP

a year ago

I did not


dayblox
HOBBYOP

a year ago

On railway, it works when every required param is specified though


dayblox
HOBBYOP

a year ago

This only happens when Elysia returns an error json


dayblox
HOBBYOP

a year ago

How would I go about doing that the closest possible to the way railway does it?


dayblox
HOBBYOP

a year ago

Just found the solution!
Elysia weirdly fails validation when NODE_ENV=production, setting it to development did the trick for now


Loading...