dayjs tz function dont work on railway
Hello, is the nodejs Date object handle other that in windows ? I have this error in production
Argument gte for where.date.gte is not a valid Date object.
but in local i don't have a errorSolution:Jump to solution
I'd write the dockerfile for you, but I'm currently limited to mobile right now
27 Replies
Project ID:
152ff848-e90d-48e6-9bfd-f487495da195
how i get the date :
Definition of DayJS :
Full error :
before i don't use .tz() but i got not the good date, it filter with utc timezone, and for my project i neeted French timezone hours
oh wow I didn't know this was still an issue, and the solution usually ends up being use a Dockerfile
i have found a thing here : https://stackoverflow.com/questions/75129234/day-js-timezone-plugin-method-produce-an-invalid-date
a issue with nodejs fixed after 18.13
Is possible to start in a specific minor version or not ?
Stack Overflow
day.js timezone plugin method produce an invalid Date
I used a long time, dayjs in an angular project, to convert timestamps in a rest response from UTC to localtime. After my last update, it does not work anymore. It is not the first problem with day...
nope, but there's a possibility that specifying node 18 could use a node 18 version greater than 18.13
in your package.json set
engines.node
to 18i have add node version in env variable
and what version is actually being installed
i don't have info about minor version
v18.12.1 from one of my bots
temporarily change your start command to
node --version
or whatever prints the version lol
ah thanks mozzy
so I assume if this is fixed in 18.13 it would also be fixed in 19x?yes i think but nixpacks only accept 14, 16 and 18 no ?
damn you right
well back to the original solution, dockerfile
@arcoz no, sorry i don't know
i can use another version of node with that ?
you can use any version of node even patch versions
Solution
I'd write the dockerfile for you, but I'm currently limited to mobile right now
okay thanks, docket is a technologie that i have planed to learn but never used right now
I mean you don't need to know docker to write a dockerfile, I know very little about the docker system myself
is this good ?
long to build the image localy 🥲
I recommend
npm ci
instead of npm install
railway can cache most layers of the dockerfile
they'd also already have a cache of node:19
okay
https://docs.railway.app/deploy/dockerfiles#environment-variables
I need to redeclare all env variable in dockerfile ?
not in your case since you aren't using any variables during build time
but yeah that's a very basic dockerfile with lots of room for improvement, but it should get you up and running just fine
it work nice !
finaly i use npm install because localy i use pnpm and so don't have a package.lock.json
I've never seen the point in pnpm, but all good!
okay, thanx for all