10 months ago
For some reason, installing the dependencies and following the exact steps that runs on the CI locally, it works. For some reason, it doesnt work on the deploy, due to some problem on build. Is there any cache? How can I avoid building with cache? I want to rebuild this from scratch to reduce the possibilities. Can railway possibly not be using the same NodeJS version that is set on package.json?
12 Replies
I've bumped some of my nodejs dependencies and the problem started, but even if I remove the node_modules locally and make everything that build/deploy process does, it fails remotely.
I've bumped some of my nodejs dependencies and the problem started, but even if I remove the node_modules locally and make everything that build/deploy process does, it fails remotely.
10 months ago
Please send your logs. you can download the full logs from the deployment page by clicking ctrl+k and selecting download logs
The error log is this
Error [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/nodemailer-express-handlebars/index.js from /app/dist/mail/mail.service.js not supported.
Instead change the require of index.js in /app/dist/mail/mail.service.js to a dynamic import() which is available in all CommonJS modules.
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at Object. (/app/dist/mail/mail.service.js:20:57) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v22.11.09 months ago
!s
Status changed to Solved adam • 10 months ago