Nuxt 3 issue Cannot find module '/var/task/server'

Hi guys,

My nuxt3 (~3.4.3) app deploy was successful, all was green, but when i test the url i have this error :

This function has crashed

Runtime.ImportModuleError - Error: Cannot find module '/var/task/server' Require stack: - /var/runtime/index.mjs
Stack trace
Runtime.ImportModuleError: Error: Cannot find module '/var/task/server'
Require stack:
- /var/runtime/index.mjs
    at _loadUserApp (file:///var/runtime/index.mjs:997:17)
    at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1032:21)
    at async start (file:///var/runtime/index.mjs:1195:23)
    at async file:///var/runtime/index.mjs:1201:1

Anyone know what’s happening ? What i missed ?

Thanks.

Can you attach the full function log and how you have it configured

Jun 22, 08:15:46 AM: INIT_START Runtime Version: nodejs:18.v7	Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:*******
Jun 22, 08:15:46 AM: 2023-06-22T06:15:46.610Z	undefined	ERROR	Uncaught Exception 	{"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module '/var/task/server'\nRequire stack:\n- /var/runtime/index.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module '/var/task/server'","Require stack:","- /var/runtime/index.mjs","    at _loadUserApp (file:///var/runtime/index.mjs:997:17)","    at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1032:21)","    at async start (file:///var/runtime/index.mjs:1195:23)","    at async file:///var/runtime/index.mjs:1201:1"]}
Jun 22, 08:15:46 AM: 2023-06-22T06:15:46.849Z	undefined	ERROR	Uncaught Exception 	{"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module '/var/task/server'\nRequire stack:\n- /var/runtime/index.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module '/var/task/server'","Require stack:","- /var/runtime/index.mjs","    at _loadUserApp (file:///var/runtime/index.mjs:997:17)","    at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1032:21)","    at async start (file:///var/runtime/index.mjs:1195:23)","    at async file:///var/runtime/index.mjs:1201:1"]}
Jun 22, 08:15:46 AM: Unknown application error occurred
Runtime.ImportModuleErrorJun 22, 08:15:46 AM: 84c1bb32 Duration: 202.52 ms	Memory Usage: 17 MB	

Config :

Build command : npm run build
Publish directory : dist

Functions directory : Not set (seems to not needed because netlify reognize nuxt3 app and get server directory as functions)

Some build importantlog extract :

8:24:41 AM: [log] Nuxi 3.4.3
8:24:41 AM: [log] Nuxt 3.4.3 with Nitro 2.4.1
8:24:57 AM: [info] ✓ built in 14.65s
8:24:57 AM: [success] Client built in 14655ms
8:24:57 AM: [info] Building server…
8:24:57 AM: [info] vite v4.3.9 building SSR bundle for production…
8:25:03 AM: [success] Server built in 5559ms
8:25:03 AM: [success] [nitro] Generated public dist
8:25:03 AM: [info] [nitro] Building Nitro Server (preset: netlify)
8:25:19 AM: Packaging Functions from .netlify/functions-internal directory:
8:25:19 AM: - server/server.mjs
8:28:57 AM: (Functions bundling completed in 3m 38.7s)
8:29:06 AM: (Netlify Build completed in 4m 25.4s)
8:29:07 AM: Section completed: building
8:29:10 AM: Finished processing build request in 4m50.371s

What site is this about?