Skip to content

Node 14.18 with http2: Uploading of files produces exception in deepmerge #274

Closed
@mccare

Description

@mccare

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

3.21.6

Plugin version

5.0.1

Node.js version

14.18

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

cloud

Description

Since node 14.18 I get an exception when uploading a file. This is on Google Cloud Run with http2 enabled.
The stack trace shows:

TypeError: target.propertyIsEnumerable is not a function
    at /usr/src/app/node_modules/deepmerge/dist/cjs.js:55:18
    at Array.filter (<anonymous>)
    at getEnumerableOwnPropertySymbols (/usr/src/app/node_modules/deepmerge/dist/cjs.js:54:42)
    at getKeys (/usr/src/app/node_modules/deepmerge/dist/cjs.js:61:36)
    at mergeObject (/usr/src/app/node_modules/deepmerge/dist/cjs.js:86:2)
    at deepmerge (/usr/src/app/node_modules/deepmerge/dist/cjs.js:117:10)
    at cloneUnlessOtherwiseSpecified (/usr/src/app/node_modules/deepmerge/dist/cjs.js:34:5)
    at /usr/src/app/node_modules/deepmerge/dist/cjs.js:94:23
    at Array.forEach (<anonymous>)
    at mergeObject (/usr/src/app/node_modules/deepmerge/dist/cjs.js:86:18)

I've verified this by creating a sample project pushing it to google cloud run and uploading a file. It could be related to nodejs/node#34145 (comment) where the user reports errors when iterating of the headers.

Steps to Reproduce

I've created a sample project here and deployed this version on cloud run.

Run for the Cloud run version
curl -v -F key1=value1 -F upload=@./package.json https://multipart-5knuaozepq-uc.a.run.app/upload

Expected Behavior

The server should just return "ok".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions