Skip to content

TypeError: Cannot read properties of undefined (reading 'length') when fieldNameSize is not set #1233

@dvtradeling

Description

@dvtradeling

We use Nest.js FilesInterceptor which uses multer under the hood.

When fieldname is not provided, but fieldNameSize is set, the above line is still executed and TypeError is thrown accordingly.
Check this - https://github.com/expressjs/multer/blob/master/lib/make-middleware.js#L103

We need to prevent it.

Screenshot 2023-10-04 at 12 39 44

For fixing this issue please add this line
Screenshot 2023-10-04 at 12 53 18

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