Skip to content

Add full support for Serverless Framework v4 (and native build.esbuild) #214

@BuhayovA

Description

@BuhayovA

When using serverless-offline-sns with the current Serverless Framework v4 (≥ 4.0.0), the plugin crashes during startup

Plugin is not aware of the framework’s native esbuild lifecycle.
If we dont apply a manual “esbuild workaround”, Lambda code isn’t bundled at all, so the service boots with empty handler files and fails immediately.

Error: Cannot find module 'src/handler.js'      # Lambda file never built

Current “must-have” hack

// serverless.ts
build: { esbuild: false }          #  disable v4 native builder
plugins: ["serverless-esbuild"]            #  old plugin as a replacement

Could you please add v4-compatible build handling (or at least document the requirement)?
Right now without the hack Lambda files never compile, leading to a fatal “handler not found” error during sls offline startup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions