2 years ago
I'm running a NestJS project on Railway and using @nestjs/schedule for task scheduling. Everything works fine locally, but when deployed to Railway, I get the following error:
at SchedulerOrchestrator.addCron (/app/node_modules/@nestjs/schedule/dist/scheduler.orchestrator.js:90:38)It seems that Railway's environment is not properly loading the native crypto module, which is available in Node.js 20+.
Has anyone encountered this issue before or knows how to force the crypto module to load properly on Railway?
24 Replies
2 years ago
Can you clean your node modules locally to see if you have something cached that's misleading you into thinking your build is working?
2 years ago
after cleaning your modules and re-installing?
2 years ago
Not personally sure, my node knowledge is weak - so, check nestjs/schedule is up to date.
Will let someone else take a stab.
2 years ago
stupid one: did you import/define it it?
2 years ago
Are you using nixpacks or your own dockerfile?
2 years ago
If so, nixpacks defaults to Node 18 according to docs
2 years ago
and this is in a server component?
2 years ago
override it with some of the options shown here and try building again
2 years ago
the crypto package was only globally available in node in version >=19 afaik
2 years ago
thank you medim!
2 years ago
!s
Status changed to Solved brody • over 1 year ago

