Nest: MulterModule not found in @nestjs/common

Created on 29 Feb 2020  路  5Comments  路  Source: nestjs/nest

Bug Report

It's mentioned in the documentation that Nestjs provides a built-in module for multer. However, on trying to import it from the @nestjs/common we received an error that the package doesn't have any exported member with that name.

Current behaviour

"/node_modules/@nestjs/common"' has no exported member 'MulterModule'.

Input Code

import { Module, MulterModule } from '@nestjs/common';

@Module({
  imports: [
    MulterModule.register({
      dest: './public',
    }),
  ],
})
export class AppModule { }

Environment


Nest version: 6.14.2

For Tooling issues:
- Node version: 13.6.0
- Platform:  Windows 10
needs triage

Most helpful comment

The MulterModule comes from the @nestjs/platform-express package

All 5 comments

The MulterModule comes from the @nestjs/platform-express package

@jmcdo29 it isn't mentioned in the docs anywhere. Can please someone update the documentation for the same.

Thanks.

You wanna make a PR for it? The docs are open source so this stuff can get fixed. It is implicitly mentioned, but only in passing at the beginning of the article

Warning
Multer cannot process data which is not in the supported multipart format (multipart/form-data). Also, note that this package is not compatible with the FastifyAdapter.

Which _could_ lead one to believe it'll be from the platform-express package, but as it isn't explicit, it is a bit confusing

Thanks and sure I will make a PR for it.

I've just added a hint
image

Thank you for your contribution though

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thohoh picture thohoh  路  3Comments

yanshuf0 picture yanshuf0  路  3Comments

JulianBiermann picture JulianBiermann  路  3Comments

mishelashala picture mishelashala  路  3Comments

janckerchen picture janckerchen  路  3Comments