nuxt / vercel-builder

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

500 Function invokation failed #806

Closed stephanepericat closed 1 year ago

stephanepericat commented 1 year ago

Hi,

I am facing a 500 error "FUNCTION_INVOKATION_FAILED" on a Nuxt 3.5.3 project.

Screen Shot 2023-06-07 at 9 59 37 AM

When I check the logs, I see the following error:

2023-06-07T14:58:33.408Z    undefined   ERROR   Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/node_modules/unstorage/drivers/fs.mjs' imported from /var/task/index.mjs
    at new NodeError (node:internal/errors:399:5)
    at finalizeResolution (node:internal/modules/esm/resolve:331:11)
    at moduleResolve (node:internal/modules/esm/resolve:994:10)
    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:938:12)
    at defaultResolve (node:internal/modules/esm/resolve:1202:79)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
    at link (node:internal/modules/esm/module_job:76:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
RequestId: 7857cfe2-4cfd-454d-a2a7-e39b455d7e67 Error: Runtime exited with error: exit status 1
Runtime.ExitError

So it seems related to this package: https://github.com/unjs/unstorage

Any idea how to fix it ?

App is hosted here: https://covid-conscious.vercel.app/ Code is here: https://github.com/stephanepericat/cccc-platform

danielroe commented 1 year ago

You likely need to deduplicate your package lockfile. I think you have multiple versions of unstorage installed.

danielroe commented 1 year ago

Note that you should not use nuxt/vercel-builder if you are using Nuxt 3. Nuxt 3 has built-in support for vercel....

stephanepericat commented 1 year ago

You likely need to deduplicate your package lockfile. I think you have multiple versions of unstorage installed.

hey @danielroe , thanks for the tip :) i deleted my yarn lock, ran yarn install and committed the code to deploy... it works now :) Thanks a lot!

sultondev commented 1 year ago

@danielroe It works fine. Thanks.

studentofcoding commented 1 year ago

Hey guys,

You likely need to deduplicate your package lockfile. I think you have multiple versions of unstorage installed.

hey @danielroe , thanks for the tip :) i deleted my yarn lock, ran yarn install and committed the code to deploy... it works now :) Thanks a lot!

Hey @stephanepericat, I've recently got this issue as well, do we have to add yarn.lock to .gitignore or push it to Vercel? thanks

cc @danielroe @sultondev

sultondev commented 1 year ago

@studentofcoding

Delete yarn.lock after add yarn.lock in .gitignore file and commit and push