Failing Deployments Due To Failing Layer0 Lambda Functions on DeployBuild

I am working on a Nuxt 2.15.8 application and I have the following packages installed:

@layer0/cli”: “^4.18.0”,
@layer0/core”: “^4.18.0”,
@layer0/devtools”: “^4.18.0”,
@layer0/nuxt”: “^4.18.0”,
@layer0/prefetch”: “^4.18.0”,
@layer0/vue”: “^4.18.0”,

I also have the same cli version installed globally on my mac. There is no reference or usage of XDN anywhere in the project.

When running npm run layer0:dev my application compiles and loads properly on my localhost. But when I try to deploy to a develop environment in layer0 it keeps failing with this error:

2022-08-05T17:35:53Z - info - > Build package received
2022-08-05T17:36:01Z - info - -----------------------
2022-08-05T17:36:01Z - info - DeployBuild job started
2022-08-05T17:36:01Z - info - Running job 'deployBuild' on xdn-build-lambda v4.18.0
2022-08-05T17:36:02Z - info - > Uploading static assets
2022-08-05T17:36:18Z - info - > Deploying Serverless functions
2022-08-05T17:36:18Z - info - Disabling SumoLogic logger for accoundId: 643149502086
2022-08-05T17:36:18Z - info - Disabling SumoLogic logger for accoundId: 643149502086
2022-08-05T17:36:27Z - info - > Cloud deployments live at:
2022-08-05T17:36:27Z - info - --> https://changing-branch-name-for-security.layer0-perma.link
2022-08-05T17:36:27Z - info - > Deploying to environment "develop" (c0fbba7f-866e-418f-acc6-6a96b52a5011)
2022-08-05T17:36:27Z - info - > Fetching user edge configuration
2022-08-05T17:36:30Z - error - DeployBuild job failed: Error while invoking lambda "fb47cccf645f190446c3be33f3b985348b0c37db4aad426a988044170ad50d94": Cannot find module 'chokidar'
Require stack:
- /var/task/routes.js
- /var/task/handler.js
- /var/task/layer0UserLambdaRuntimeWrapper.js
- /var/runtime/UserFunction.js
- /var/runtime/Runtime.js
- /var/runtime/index.js

2022-08-05T17:36:30Z - info - 
Build failed: DeployBuild job failed: Error while invoking lambda "fb47cccf645f190446c3be33f3b985348b0c37db4aad426a988044170ad50d94": Cannot find module 'chokidar'
Require stack:
- /var/task/routes.js
- /var/task/handler.js
- /var/task/layer0UserLambdaRuntimeWrapper.js
- /var/runtime/UserFunction.js
- /var/runtime/Runtime.js
- /var/runtime/index.js

Hi Sam,

Based on the error message, looks like a module is being referenced possibly in your router that isn’t being bundled with the project:

Build failed: DeployBuild job failed: Error while invoking lambda "fb47cccf645f190446c3be33f3b985348b0c37db4aad426a988044170ad50d94": 
Cannot find module 'chokidar'
Require stack:
- /var/task/routes.js

Are you using this directly, or able to see if there is another module depending on it? For reference, I used this example app to test against and did not receive the error: GitHub - layer0-docs/layer0-nuxt-isg-example: An example app that shows how Layer0 provides ISG functionality on Nuxt, similar to how Next.js does it.

Hi @tristan.lee,

Im facing the same error.
chokidar is an indirect dependency of my project. I did yarn list to check and it seems to be used by many modules (tailwindcss for instance)
I tried to add it directly in my package.json but that doesn’t resolve the issue.
Any help would be appreciated. Thank you.

@sam if by any chance you fixed the issue, i’m keen to hear the solution :sweat_smile: