Error: Cannot find module '/tmp/task' - impossible to work with service!
Lancer92 opened this issue · 3 comments
All requests responds with {"message":"Internal Server Error"}
In the logs at https://cloud.serverless.com/:orgId/services/:serviceId/instances/:instanceId/overview
there are next:
Error: Cannot find module '/tmp/task'
2021:09:27 12:24:54 pm
Require stack:
2021:09:27 12:24:54 pm
- /opt/cloud-runtime/private.cjs
2021:09:27 12:24:54 pm
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
2021:09:27 12:24:54 pm
at Function.resolve (node:internal/modules/cjs/helpers:100:19)
2021:09:27 12:24:54 pm
at new FN (/opt/cloud-runtime/private.cjs:78:41145)
2021:09:27 12:24:54 pm
at file:///opt/worker.mjs:8:21
2021:09:27 12:24:54 pm
at file:///opt/worker.mjs:93:3
2021:09:27 12:24:54 pm
at ModuleJob.run (node:internal/modules/esm/module_job:183:25)
2021:09:27 12:24:54 pm
at Loader.import (node:internal/modules/esm/loader:178:24)
2021:09:27 12:24:54 pm
at Object.loadESM (node:internal/process/esm_loader:68:5)
2021:09:27 12:24:54 pm
at handleMainPromise (node:internal/modules/run_main:63:12) {
2021:09:27 12:24:54 pm
code: 'MODULE_NOT_FOUND',
2021:09:27 12:24:54 pm
requireStack: [ '/opt/cloud-runtime/private.cjs' ]
2021:09:27 12:24:54 pm
}
Hey, can you update to the latest CLI and redeploy?
Hey, can you update to the latest CLI and redeploy?
Yes, after update I started to see error, there was missing dependency
const { v4 } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at ModuleJob.run (node:internal/modules/esm/module_job:179:5)
at Loader.import (node:internal/modules/esm/loader:178:24)
at importModuleDynamicallyWrapper (node:internal/vm/module:437:15)
at jN.handler (/opt/cloud-runtime/private.cjs:39:41479)
at file:///opt/worker.mjs:79:24
It was in booking-api example, but I removed it because Node.js 16 has it's native implementation.
Now I replaced it in all places and all works.
Thanks for fast response and help!
It was in booking-api example, but I removed it because Node.js 16 has it's native implementation.
Good point! Glad to help and we will work on making sure logs are always accessible when you need them.