Skip to content

serverless-http doesn't work on Netlify Function #7305

Open
@dongwa

Description

@dongwa

Describe the bug

I have provided a minimal reproducible code, using express + serverless-http, deployed on netlify, which can be deployed successfully, but an error will be reported when accessing the web page:

TypeError: Cannot set property body of #<_Request> which has only a getter at cleanupEvent (/var/task/node_modules/serverless-http/lib/provider/aws/clean-up-event.js:70:14) at /var/task/node_modules/serverless-http/lib/provider/aws/index.js:8:19 at file:///var/task/___netlify-bootstrap.mjs:2:34331 at AsyncLocalStorage.run (node:internal/async_local_storage/async_hooks:91:14) at Runtime.handler (file:///var/task/___netlify-bootstrap.mjs:2:34321) at async Runtime.handleOnceStreaming (file:///var/runtime/index.mjs:1206:26)

Image

Image

Steps to reproduce

git clone [email protected]:dongwa/express-netlify.git
cd express-netlify
nelify deploy

Configuration

No response

Environment

  System:
    OS: macOS 15.4.1
    CPU: (10) arm64 Apple M4
    Memory: 88.75 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - /usr/local/bin/node
    Yarn: 1.22.22 - ~/n/bin/yarn
    npm: 11.3.0 - /usr/local/bin/npm
    pnpm: 10.5.2 - ~/n/bin/pnpm
  npmGlobalPackages:
    netlify-cli: 21.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugcode to address defects in shipped code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions