nuxt / vercel-builder

Vercel Builder for Nuxt
MIT License
645 stars 76 forks source link

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

Open udemezue01 opened 2 years ago

udemezue01 commented 2 years ago

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

Screenshot (498)

Tragio commented 2 years ago

@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 commented 2 years ago

@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 commented 2 years ago

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

udemezue01 commented 2 years ago

I dont even know, I am confused

joshistoast commented 2 years ago

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:  `yarn@1.22.17`
- Builder:          `vite`
- User Config:      `ssr`, `meta`, `css`, `components`, `runtimeConfig`, `buildModules`, `modules`, `schemaOrg`, `plausible`, `prismic`, `vite`, `build`
- Runtime Modules:  `@unlighthouse/nuxt@0.3.29`, `@nuxtjs/prismic@3.0.0-alpha.5`, `vue-plausible@1.3.1`, `nuxt-schema-org@0.6.2`
- Build Modules:    `@pinia/nuxt@0.1.9`, `@vueuse/nuxt@8.9.1`
------------------------------
[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 commented 2 years ago

How did you solve it

On Thu, 14 Jul 2022, 9:49 pm Josh Corbett, @.***> wrote:

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: @.***`
  • Builder: vite
  • User Config: ssr, meta, css, components, runtimeConfig, buildModules, modules, schemaOrg, plausible, prismic, vite, build
  • Runtime Modules: @.**@., ***@***.******@***.***, @.`, @.`
  • Build Modules: @.**@., ***@***.******@***.***

[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. (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. (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

— Reply to this email directly, view it on GitHub https://github.com/nuxt/vercel-builder/issues/680#issuecomment-1184884127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD2KU4NDHTBFUGSNXF3AYYTVUB4OBANCNFSM5ZCG6P5A . You are receiving this because you were mentioned.Message ID: @.***>

joshistoast commented 2 years ago

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 commented 2 years ago

Hey guys! Have you found any solutions for this?

udemezue01 commented 2 years ago

No, not yet.

On Sat, Sep 3, 2022 at 5:38 PM Zumrad @.***> wrote:

Hey guys! Have you found any solutions for this?

— Reply to this email directly, view it on GitHub https://github.com/nuxt/vercel-builder/issues/680#issuecomment-1236161114, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD2KU4J4Q2EY4MAK2LJHHQTV4N5INANCNFSM5ZCG6P5A . You are receiving this because you were mentioned.Message ID: @.***>

-- https://about.me/thejohnbenjamin?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb Nwabufor John

Web Developer, Blogger, Digital Marketing Expert and Serial Entrepreneur.

Visit the Link Below.

Tchelete.com http://Tchelete.com (Blog)

Make sure to also visit the links below. 🖐🏼

👉👉 How To Start a Blog. http://Tchelete.com/how-to-start-a-blog

udemezue01 commented 2 years ago

Instead I now use Cloudflare Pages

On Sat, Sep 3, 2022 at 6:20 PM John Nwabufor Udemezue @.***> wrote:

No, not yet.

On Sat, Sep 3, 2022 at 5:38 PM Zumrad @.***> wrote:

Hey guys! Have you found any solutions for this?

— Reply to this email directly, view it on GitHub https://github.com/nuxt/vercel-builder/issues/680#issuecomment-1236161114, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD2KU4J4Q2EY4MAK2LJHHQTV4N5INANCNFSM5ZCG6P5A . You are receiving this because you were mentioned.Message ID: @.***>

--

https://about.me/thejohnbenjamin?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb Nwabufor John

Web Developer, Blogger, Digital Marketing Expert and Serial Entrepreneur.

Visit the Link Below.

Tchelete.com http://Tchelete.com (Blog)

Make sure to also visit the links below. 🖐🏼

👉👉 How To Start a Blog. http://Tchelete.com/how-to-start-a-blog

-- https://about.me/thejohnbenjamin?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb Nwabufor John

Web Developer, Blogger, Digital Marketing Expert and Serial Entrepreneur.

Visit the Link Below.

Tchelete.com http://Tchelete.com (Blog)

Make sure to also visit the links below. 🖐🏼

👉👉 How To Start a Blog. http://Tchelete.com/how-to-start-a-blog

thezumrad commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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

klukiyan commented 2 years ago

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