Next.js Discord

Discord Forum

Serverless Function has crashed!

Unanswered
Barbary Lion posted this in #help-forum
Open in Discord
Barbary LionOP

17 Replies

Barbary LionOP
I have tried configuring all sorts of things to deploy our serverless functions on vercel
but none have worked
does it have anything to do with the packages?
or
{
  "version": 2,
  "builds": [
    {
      "src": "./server.js",
      "use": "@vercel/node"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "server.js"
    }
  ]
}
the vercel.json?
what am I doing wrong here
on my local machine it runs normally
Chilean jack mackerel
check the vercel logs
Barbary LionOP
it is saying here
message:Error: EROFS: read-only file system, mkdir '/var/task/public'
    at Object.mkdirSync (node:fs:1396:3)
    at sync (/var/task/node_modules/mkdirp/index.js:74:13)
    at Function.sync (/var/task/node_modules/mkdirp/index.js:80:24)
    at new DiskStorage (/var/task/node_modules/multer/storage/disk.js:21:12)
    at module.exports [as diskStorage] (/var/task/node_modules/multer/storage/disk.js:65:10)
    at Object.<anonymous> (/var/task/apps/sleek_vehicle_management/app/routes/body_style.routes.js:5:28)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12) {
  errno: -30,
  syscall: 'mkdir',
  code: 'EROFS',
  path: '/var/task/public'
}
RequestId: cedcff22-8830-48eb-b782-616f786372a8 Error: Runtime exited without providing a reason
Runtime.ExitError
not sure what is this error
not using any libraries to read/write files here
Chilean jack mackerel
well i think the easiest way is just to disable all packages which are loaded when you enter the page and enable one by one to find which one is crashing.
Barbary LionOP
can you do that?
I didn't know about that