dmitriy-nz / nestjs-form-data

NestJS middleware for handling multipart/form-data, which is primarily used for uploading files.
https://www.npmjs.com/package/nestjs-form-data
MIT License
118 stars 23 forks source link

not working with nestjs 8 #10

Closed wodka closed 3 years ago

wodka commented 3 years ago

it seems like nestjs 8 will require peerDependencies to be set so that no second version of nestJs core get installed.

else it will fail with:

ERROR [ExceptionHandler] Nest can't resolve dependencies of the FormDataInterceptor (Symbol(Inject token for NestJsFormData global configuration object), ?). Please make sure that the argument Reflector at index [1] is available in the NestjsFormDataModule context.

Potential solutions:
- If Reflector is a provider, is it part of the current NestjsFormDataModule?
- If Reflector is exported from a separate @Module, is that module imported within NestjsFormDataModule?
  @Module({
    imports: [ /* the Module containing Reflector */ ]
  })
dmitriy-nz commented 3 years ago

Hi, thanks for the feedback. The problem is fixed in version 1.4.5 which is already available on npm

wodka commented 3 years ago

just tried it out.

it works! - thank you!

but it still installs the additional node_modules: image

I have tried it and it also works with the 8.0.5 version of nestjs - I forced this by adding the resolutions to package.json:

  "resolutions": {
    "@nestjs/common": "8.0.5",
    "@nestjs/core": "8.0.5",
    "@nestjs/platform-express": "8.0.5",
    "@nestjs/testing": "8.0.5"
  },

so perhaps it might also fix the problem to add the dependencies for nestjs 7 + 8 and allow it in the peer dependencies with the same version

dmitriy-nz commented 3 years ago

Are you using yarn? I didn't find any documentation at docs.npmjs.com for the resolutions object in package.json I'll set up peerDependencies to avoid duplication

wodka commented 3 years ago

yes I'm using yarn - thought there is a similar thing with npm as well^^

dmitriy-nz commented 3 years ago

I have configured peerDependencies, try version 1.4.7 with npm

wodka commented 3 years ago

just tried it - it now also with yarn no longer installs the sub packages! thank you for changing this.

dmitriy-nz commented 3 years ago

Thank you for noticing this 🙂

yepMad commented 2 years ago

I'm still facing this on 8.0.0