dherault / serverless-offline

Emulate AWS λ and API Gateway locally when developing your Serverless project
MIT License
5.16k stars 794 forks source link

Serverless V4 Support #1800

Open fabianobonomini opened 2 weeks ago

fabianobonomini commented 2 weeks ago

there is the possibility that serverless-offline will support also serverless v4 in the near future? Any idea about the time span? Thanks Fabiano

NicoHinderling commented 1 week ago

Just wanted to +1 this, as I've also been facing this issue

here's an example log when I tried hitting my "/sidebar" endpoint and the logic tried to resolve the "handler" in my serverless.yml

GET /sidebar (λ: bigRoute)
✖ Unhandled exception in handler 'bigRoute'.
✖ Error: Cannot find module 'routing'
Require stack:
- /Users/nicolashinderling/dev/emerge-pnpm-on-hold/node_modules/.pnpm/serverless-offline@13.6.0_serverless@4.0.24/node_modules/serverless-offline/src/lambda/handler-runner/in-process-runner/aws-lambda-ric/UserFunction.js
Runtime.ImportModuleError: Error: Cannot find module 'routing'
Require stack:
- /Users/nicolashinderling/dev/emerge-pnpm-on-hold/node_modules/.pnpm/serverless-offline@13.6.0_serverless@4.0.24/node_modules/serverless-offline/src/lambda/handler-runner/in-process-runner/aws-lambda-ric/UserFunction.js
    at _loadUserApp (/Users/nicolashinderling/dev/emerge-pnpm-on-hold/node_modules/.pnpm/serverless-offline@13.6.0_serverless@4.0.24/node_modules/serverless-offline/src/lambda/handler-runner/in-process-runner/aws-lambda-ric/UserFunction.js:310:15)
    at async module.exports.load (/Users/nicolashinderling/dev/emerge-pnpm-on-hold/node_modules/.pnpm/serverless-offline@13.6.0_serverless@4.0.24/node_modules/serverless-offline/src/lambda/handler-runner/in-process-runner/aws-lambda-ric/UserFunction.js:341:21)
    at async InProcessRunner.run (file:///Users/nicolashinderling/dev/emerge-pnpm-on-hold/node_modules/.pnpm/serverless-offline@13.6.0_serverless@4.0.24/node_modules/serverless-offline/src/lambda/handler-runner/in-process-runner/InProcessRunner.js:41:21)
    at async MessagePort.<anonymous> (file:///Users/nicolashinderling/dev/emerge-pnpm-on-hold/node_modules/.pnpm/serverless-offline@13.6.0_serverless@4.0.24/node_modules/serverless-offline/src/lambda/handler-runner/worker-thread-runner/workerThreadHelper.js:24:14)
✖ Error: Cannot find module 'routing'
Require stack:
- /Users/nicolashinderling/dev/emerge-pnpm-on-hold/node_modules/.pnpm/serverless-offline@13.6.0_serverless@4.0.24/node_modules/serverless-offline/src/lambda/handler-runner/in-process-runner/aws-lambda-ric/UserFunction.js
DorianMazur commented 1 week ago

I'll work on fixing this soon.

austencollins commented 1 week ago

Hi all, we absolutely want serverless-offline to work with V4, as always. We did some initial testing and things were working as expected. We'll look into @NicoHinderling's issue now. If you have specific issues, please post them in the Framework repo or here.

@fabianobonomini did you have a specific issue w/ offline and V4?

fabianobonomini commented 1 week ago

I had a consistent 502 bad gateway on my apiGateway+lambda function coded in vanilla javascript + node 20. the 'invocation endpoints' responded