Deploys with problem due to nodejs build
theo-nejm
HOBBYOP

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?

Solved

12 Replies

theo-nejm
HOBBYOP

10 months ago

75f448f4-88c9-4d82-b428-61740d90e40c


theo-nejm
HOBBYOP

10 months ago

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.


theo-nejm
HOBBYOP

10 months ago

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.


theo-nejm
HOBBYOP

10 months ago

75f448f4-88c9-4d82-b428-61740d90e40c


adam
MODERATOR

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


theo-nejm
HOBBYOP

10 months ago

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.0

theo-nejm
HOBBYOP

10 months ago

hmm i noticed this is a compatibility problem with hbs…


theo-nejm
HOBBYOP

10 months ago

they dont accept cjs on v7


theo-nejm
HOBBYOP

10 months ago

and nestjs builds to cjs


theo-nejm
HOBBYOP

10 months ago

ill just roll this back to an older version


theo-nejm
HOBBYOP

10 months ago

tks


adam
MODERATOR

9 months ago

!s


Status changed to Solved adam 10 months ago


Loading...