0

I built my app on NUXT JS and deployed it on Vercel, but I get the error as shown below.

enter image description here

When I opened the function log, here is what it showed me.

enter image description here

Here is a full description of the error code I get in the functions Log.

[GET] /
03:25:28:10
WARN  /var/task/content does not exist
ℹ Parsed 0 files in 203.10 seconds
FATAL  ENOENT: no such file or directory, mkdir '/var/task/.nuxt/dist/client'
2022-06-18T02:25:28.277Z    d7a5445e-ee11-4de0-b976-042d56036dc7    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.<anonymous> (/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] /
03:25:28:00
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-06-18T02:25:29.079Z    f196113c-cf3a-4725-85fa-75f87fa94c50    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.<anonymous> (/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] /
03:25:27:61
WARN  /var/task/content does not exist
ℹ Parsed 0 files in 144.5 seconds
FATAL  ENOENT: no such file or directory, mkdir '/var/task/.nuxt/dist/client'
2022-06-18T02:25:27.798Z    39e75c36-f6b6-4654-89ba-b0d9c90ae9ad    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.<anonymous> (/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

Any help debugging this would be appreciated and I use Nuxt 2

9
  • 1
    The actual configuration of the project (a minimal reproducible example) is welcome, rather than just giving us the failing result.
    – kissu
    Jun 19, 2022 at 9:41
  • 1
    Also, a serverless function is probably not meant to host a whole Nuxt app. Do you use Nuxt v2 or v3 btw?
    – kissu
    Jun 19, 2022 at 9:42
  • I make use of NUxt JS 2 Jun 19, 2022 at 11:57
  • Using Nuxt3 and getting this error out of nowhere, did you end up finding a fix? Jul 14, 2022 at 20:45
  • 1
    @joshwcorbett sure you didn't changed anything?
    – kissu
    Jul 14, 2022 at 21:01

3 Answers 3

1

This error comes after deployment of your web app. This is an error by checkly. Checkly checks that is every page is loading fine or not. If any of the page will break it will throw the error.

So in local you are checking your web app in one point of solution. if your all pages are handle accroding to every prospective(api fulfillment or error). Then your issue will be solved.

0

You can change the now/node to vercel

{
  "version": 2,
  "builds": [{
    "src": "src/index.js",
    "use": "@vercel/node"
  }],
  "routes": [{
    "src": "/(.*)",
    "dest": "src/index.js"
  }]
}
0
{
    "version": 2,
    "builds": [
        {
            "src": "index.js",
            "use": "@vercel/node"
        }
    ],
    "routes": [
        {
            "src": "/(.*)",
            "dest": "index.js"
        }
    ]
   
}

Add build script in your package.json file

"build": "[my-framework] build --output public"

 "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "nodemon src/index.js",
    "dev": "nodemon src/index.js",
    "build": "[my-framework] build --output public"
  },

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.