nest icon indicating copy to clipboard operation
nest copied to clipboard

Migration Issues Nest 4 -> 5 beta 2

Open thaoula opened this issue 8 years ago • 6 comments

I'm submitting a...


[ ] Regression 
[x ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

We are currently building an application with V4 of the framework and I have started migrating to V5 beta 2.

  1. The migration steps do not talk about using ExpressAdapter. This is needed when passing express instance.

  2. The Express Adapter does not seem to be exported by @nestjs/core ... you have to do this import { ExpressAdapter } from '@nestjs/core/adapters/express-adapter';

  3. Do we need to install Fastify? I am getting this error on all apps - Error: Cannot find module 'fastify-formbody'

  4. Dynamic module reports the following error - Nest cannot export component / module that is not a part of the currently proccessed module (MongooseModule)

Our dynamic module looks like this

return { module: MongooseModule, components: [ mongooseProvider, ...schemaProviders, ...repositoryProviders ], exports: [ mongooseProvider, ...schemaProviders, ...repositoryProviders ] };

Expected behavior

  1. The documentation would define this as a possible migration step.

  2. The ExpressAdapter would be exported by @nestjs/core

  3. App would start and would not have a dependency on fastify unless i used fastify adapter.

  4. Dynamic module would work like v4.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Nest version: 5.0.0.beta-2

 
For Tooling issues:
- Node version: v9.3.0
- Platform:  Mac (Docker)

Others:

thaoula avatar Apr 19 '18 07:04 thaoula

Hey @thaoula

You need to update components to providers in your dynamic module metadata

thomrick avatar Apr 21 '18 08:04 thomrick

1, 2, 3 will be fixed in v5.0.0-beta.3. I can't reproduce 4th issue. 🙁

kamilmysliwiec avatar Apr 21 '18 09:04 kamilmysliwiec

All those issues should be fixed in v5.0.0-beta.3. Let me know if you face any issues

kamilmysliwiec avatar Apr 22 '18 10:04 kamilmysliwiec

I have upgraded to the latest beta.

Working through some injections issues and nest-router.

Thanks very much!!

Get Outlook for iOShttps://aka.ms/o0ukef


From: Kamil Myśliwiec [email protected] Sent: Sunday, April 22, 2018 5:15:39 PM To: nestjs/nest Cc: Tarek Haoula; Mention Subject: Re: [nestjs/nest] Migration Issues Nest 4 -> 5 beta 2 (#575)

Closed #575https://github.com/nestjs/nest/issues/575.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/nestjs/nest/issues/575#event-1587795687, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAVTzRLzAy_ZB-AOF-gtQqd9KOAAiHt0ks5trFhLgaJpZM4TbQy4.

thaoula avatar Apr 23 '18 15:04 thaoula

Just to clarify:

  • the 4th is happening when someone is exporting something that is not declaring as component.

nuno-morais avatar May 13 '18 08:05 nuno-morais

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Sep 25 '19 00:09 lock[bot]