Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I deployed my Nuxt Js app on Vercel and I get this error "This Serverless Function has crashed." #680

Open
udemezue01 opened this issue Jun 17, 2022 · 14 comments

Comments

@udemezue01
Copy link

I deployed my Nuxt Js app on Vercel and I get this error "This Serverless Function has crashed."

Screenshot (498)

@Tragio
Copy link

Tragio commented Jul 8, 2022

@udemezue01 you can go to your build inside Vercel and click on Functions to see what error it's throwing.

CleanShot 2022-07-08 at 09 41 15@2x

@udemezue01
Copy link
Author

udemezue01 commented Jul 8, 2022

@Tragio Tragio This is what the functions tab logs

``
[GET] /
11:27:47:40
WARN /var/task/content does not exist
ℹ Parsed 0 files in 0.0 seconds
FATAL ENOENT: no such file or directory, mkdir '/var/task/.nuxt/dist/client'
2022-07-08T10:27:47.704Z 9e3180a3-c1a6-497d-9521-79d4ee168c56 ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'","reason":{"errorType":"Error","errorMessage":"ENOENT: no such file or directory, open '/var/task/static/sw.js'","code":"ENOENT","errno":-2,"syscall":"open","path":"/var/task/static/sw.js","stack":["Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'"," at process. (/var/runtime/index.js:35:15)"," at process.emit (events.js:412:35)"," at processEmit [as emit] (/var/task/node_modules/signal-exit/index.js:199:34)"," at processPromiseRejections (internal/process/promises.js:245:33)"," at processTicksAndRejections (internal/process/task_queues.js:96:32)"]}
Unknown application error occurred

[GET] /
11:27:46:57
WARN /var/task/content does not exist
ℹ Parsed 0 files in 34.5 seconds
FATAL ENOENT: no such file or directory, mkdir '/var/task/.nuxt/dist/client'
2022-07-08T10:27:46.760Z 35a30406-2da2-4bd2-8d34-9b8b66d1b23d ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'","reason":{"errorType":"Error","errorMessage":"ENOENT: no such file or directory, open '/var/task/static/sw.js'","code":"ENOENT","errno":-2,"syscall":"open","path":"/var/task/static/sw.js","stack":["Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'"," at process. (/var/runtime/index.js:35:15)"," at process.emit (events.js:412:35)"," at processEmit [as emit] (/var/task/node_modules/signal-exit/index.js:199:34)"," at processPromiseRejections (internal/process/promises.js:245:33)"," at processTicksAndRejections (internal/process/task_queues.js:96:32)"]}
Unknown application error occurred

[GET] /
11:27:08:01
WARN /var/task/content does not exist
ℹ Parsed 0 files in 0.0 seconds
FATAL ENOENT: no such file or directory, mkdir '/var/task/.nuxt/dist/client'
2022-07-08T10:27:11.146Z 61298b18-9d00-4871-9e0a-021f6ae7d1b5 ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'","reason":{"errorType":"Error","errorMessage":"ENOENT: no such file or directory, open '/var/task/static/sw.js'","code":"ENOENT","errno":-2,"syscall":"open","path":"/var/task/static/sw.js","stack":["Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'"," at process. (/var/runtime/index.js:35:15)"," at process.emit (events.js:412:35)"," at processEmit [as emit] (/var/task/node_modules/signal-exit/index.js:199:34)"," at processPromiseRejections (internal/process/promises.js:245:33)"," at processTicksAndRejections (internal/process/task_queues.js:96:32)"]}
Unknown application error occurred

[GET] /
11:27:07:92
WARN /var/task/content does not exist
ℹ Parsed 0 files in 0.0 seconds
FATAL ENOENT: no such file or directory, mkdir '/var/task/.nuxt/dist/client'
2022-07-08T10:27:10.964Z 1e196c88-09fd-48e5-ac43-d533e2fd8659 ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'","reason":{"errorType":"Error","errorMessage":"ENOENT: no such file or directory, open '/var/task/static/sw.js'","code":"ENOENT","errno":-2,"syscall":"open","path":"/var/task/static/sw.js","stack":["Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'"," at process. (/var/runtime/index.js:35:15)"," at process.emit (events.js:412:35)"," at processEmit [as emit] (/var/task/node_modules/signal-exit/index.js:199:34)"," at processPromiseRejections (internal/process/promises.js:245:33)"," at processTicksAndRejections (internal/process/task_queues.js:96:32)"]}
Unknown application error occurred

[GET] /
11:27:07:88
WARN /var/task/content does not exist
ℹ Parsed 0 files in 0.0 seconds
FATAL ENOENT: no such file or directory, mkdir '/var/task/.nuxt/dist/client'
2022-07-08T10:27:10.771Z fe00c595-290a-4650-993b-d6906bf5c07d ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'","reason":{"errorType":"Error","errorMessage":"ENOENT: no such file or directory, open '/var/task/static/sw.js'","code":"ENOENT","errno":-2,"syscall":"open","path":"/var/task/static/sw.js","stack":["Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: ENOENT: no such file or directory, open '/var/task/static/sw.js'"," at process. (/var/runtime/index.js:35:15)"," at process.emit (events.js:412:35)"," at processEmit [as emit] (/var/task/node_modules/signal-exit/index.js:199:34)"," at processPromiseRejections (internal/process/promises.js:245:33)"," at processTicksAndRejections (internal/process/task_queues.js:96:32)"]}
Unknown application error occurred
``

@Tragio
Copy link

Tragio commented Jul 8, 2022

It seems related to your sw.js. How are you importing it?

@udemezue01
Copy link
Author

I dont even know, I am confused

@joshistoast
Copy link

Experiencing this issue rn as well, difference is this is new. No code has been pushed but suddenly Vercel decided my serverless function (which I never explicitly configured) was going to crash today.

Nuxt CLI v3.0.0-rc.4                                                                                           14:47:49
RootDir: /Users/josh/Repositories/fnf-next                                                                     14:47:50
Nuxt project info:                                                                                             14:47:50

------------------------------
- Operating System: `Darwin`
- Node Version:     `v17.5.0`
- Nuxt Version:     `3.0.0-rc.4`
- Package Manager:  `[email protected]`
- Builder:          `vite`
- User Config:      `ssr`, `meta`, `css`, `components`, `runtimeConfig`, `buildModules`, `modules`, `schemaOrg`, `plausible`, `prismic`, `vite`, `build`
- Runtime Modules:  `@unlighthouse/[email protected]`, `@nuxtjs/[email protected]`, `[email protected]`, `[email protected]`
- Build Modules:    `@pinia/[email protected]`, `@vueuse/[email protected]`
------------------------------
[GET] /
14:48:57:37
2022-07-14T20:48:59.198Z	085f9597-da7b-4ffb-bd54-c4cf91a97fae	ERROR	Unhandled Promise Rejection 	{"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"[object Object]","reason":{"__v_isShallow":false,"__v_isRef":true,"_rawValue":null,"_value":null},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: [object Object]","    at process.<anonymous> (file:///var/runtime/index.mjs:775:15)","    at process.emit (node:events:539:35)","    at emit (node:internal/process/promises:140:20)","    at processPromiseRejections (node:internal/process/promises:274:27)","    at processTicksAndRejections (node:internal/process/task_queues:97:32)"]}
Unknown application error occurred
[GET] /
14:48:56:98
2022-07-14T20:48:58.731Z	b108ce0d-fbec-4b85-8d06-e0a7058f46a8	ERROR	Unhandled Promise Rejection 	{"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"[object Object]","reason":{"__v_isShallow":false,"__v_isRef":true,"_rawValue":null,"_value":null},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: [object Object]","    at process.<anonymous> (file:///var/runtime/index.mjs:775:15)","    at process.emit (node:events:539:35)","    at emit (node:internal/process/promises:140:20)","    at processPromiseRejections (node:internal/process/promises:274:27)","    at processTicksAndRejections (node:internal/process/task_queues:97:32)"]}
Unknown application error occurred

@udemezue01
Copy link
Author

udemezue01 commented Jul 14, 2022 via email

@joshistoast
Copy link

How did you solve it

I didn't. Still awaiting Vercel's pro support to see if they can do anything about it on their end.

@thezumrad
Copy link

Hey guys!
Have you found any solutions for this?

@udemezue01
Copy link
Author

udemezue01 commented Sep 3, 2022 via email

@udemezue01
Copy link
Author

udemezue01 commented Sep 3, 2022 via email

@thezumrad
Copy link

Actually, I just did by "yarn add esm".
Then had an issue with the imported js file to nuxt.config.js cause it was considering the import of the js file as a module and were looking for it.
Had to comment on it. Now looking for a workaround for it. But in end, it works after adding ems

@klukiyan
Copy link

@thezumrad Hi, can you please elaborate in more details how did you make it work?
yarn add esm didn.t help.
Still sometimes getting this 500 error on Vercel

{
  "errorType": "Runtime.UnhandledPromiseRejection",
  "errorMessage": "Error: socket hang up",
  "reason": {
    "message": "socket hang up",
    "name": "Error",
    "stack": "Error: socket hang up\n    at connResetException (node:internal/errors:692:14)\n    at TLSSocket.socketOnEnd (node:_http_client:478:23)\n    at TLSSocket.emit (node:events:539:35)\n    at endReadableNT (node:internal/streams/readable:1345:12)\n    at processTicksAndRejections (node:internal/process/task_queues:83:21)",
    "config": {
      "url": "nuxt",
      "method": "get",
      "headers": {
        "Accept": "application/json, text/plain, */*",
        "x-real-ip": "109.43.49.1",
        "x-vercel-proxied-for": "109.43.49.1",
        "sec-fetch-site": "same-origin",
        "sec-fetch-dest": "empty",
        "cache-control": "no-cache",
        "referer": "https://erawadee.ru/sw.js",
        "x-vercel-ip-latitude": "48.1663",
        "x-vercel-forwarded-for": "109.43.49.1",
        "forwarded": "for=109.43.49.1;host=erawadee.ru;proto=https;sig=0QmVhcmVyIDU4OWYzMzVkMTk4N2E1OGQ4MmViMmQwZDBjZDM2MTJmN2FhNmUxZjY5OTQzYWI0YWU0YjBlNTMxOGZlYzdkOTM=;exp=1665665720",
        "x-vercel-deployment-url": "newru-o8ko1xz79-lucky-giga.vercel.app",
        "x-forwarded-for": "109.43.49.1",
        "x-vercel-id": "fra1::hmpqt-1665665420833-5817a38f98fa",
        "pragma": "no-cache",
        "x-vercel-ip-longitude": "11.5683",
        "x-vercel-proxy-signature": "Bearer 589f335d1987a58d82eb2d0d0cd3612f7aa6e1f69943ab4ae4b0e5318fec7d93",
        "accept-encoding": "gzip, deflate",
        "x-vercel-ip-country": "DE",
        "sec-fetch-mode": "cors",
        "accept-language": "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7",
        "user-agent": "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-A515F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/18.0 Chrome/99.0.4844.88 Mobile Safari/537.36",
        "cookie": "session_id=di4Wb9ySTvAEn4FIXS6U_MjIxMDEz; auth.strategy=local; i18n_redirected=ru; session_id=5Dn6suuYCJAfmmXyk91w_MjIxMDEz",
        "x-vercel-proxy-signature-ts": "1665665720",
        "x-vercel-ip-timezone": "Europe/Berlin",
        "x-vercel-ip-country-region": "BY",
        "connection": "close",
        "qtoken": "di4Wb9ySTvAEn4FIXS6U_MjIxMDEz"
      },
      "params": {
        "dt": "index",
        "locale": "ru",
        "ip": null
      },
      "baseURL": "https://api.erawadee.com/api/",
      "transformRequest": [
        null
      ],
      "transformResponse": [
        null
      ],
      "timeout": 0,
      "xsrfCookieName": "XSRF-TOKEN",
      "xsrfHeaderName": "X-XSRF-TOKEN",
      "maxContentLength": -1,
      "maxBodyLength": -1,
      "transitional": {
        "silentJSONParsing": true,
        "forcedJSONParsing": true,
        "clarifyTimeoutError": false
      }
    },
    "code": "ECONNRESET"
  },
  "promise": {},
  "stack": [
    "Runtime.UnhandledPromiseRejection: Error: socket hang up",
    "    at process.<anonymous> (file:///var/runtime/index.mjs:1131:17)",
    "    at process.emit (node:events:539:35)",
    "    at processEmit [as emit] (/var/task/node_modules/signal-exit/index.js:199:34)",
    "    at emit (node:internal/process/promises:140:20)",
    "    at processPromiseRejections (node:internal/process/promises:274:27)",
    "    at processTicksAndRejections (node:internal/process/task_queues:97:32)"
  ]
}

@mickeymaruf
Copy link

the same issue happened with me in my node express project :( what to do?

@klukiyan
Copy link

klukiyan commented Nov 9, 2022

the same issue happened with me in my node express project :( what to do?

Hi @mickeymaruf
Replace created() with mounted() in your nuxt project and all will be good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants