-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microservice broken after update from 7 -> 8, docs provide no alternative from nestfactory.create with app.get() #8742
Comments
The microservice await app.startAllMicroservices();
console.log("MS 1 is listening ...."); We make a general mention of this here, but we can update this to be more explicit if need be. |
@jmcdo29 thanks for your answer but using my test repo, mentioned above, I never come to the console.log: Did you changed anything else within the repo ? Best regards |
Well, in your reproduction you didn't provide a way to run redis, so I didn't get any further r the invalid host error. Next time please provide as full minimum reproduction |
@Meywether run your code with |
@micalevisk Very warm welcome to the discussion :) I set the two variabes in .env: and this is the output: Can you see something ? express:application set "x-powered-by" to true +0ms
---- Here it gets stuck ^^ ---- |
Some experiments later I found a possible explaination for the not starting MS but it gets me to another problem: BUT If you want to trigger the status endpoint -> its throws me an 500 because suddenly my injected config service in status.controller ins the ms1 repo is suddenly undefined: Can you maybe tell me why ? ^^ |
Did you read the migration guide?
Is there an existing issue that is already proposing this?
Potential Commit/PR that introduced the regression
No response
NestJS version
7-8
Describe the regression
Hi there,
thanks for your time.
I create my microservices by creating a INestApplication as seen here in this repo: https://github.com/Meywether/nestjs_ms1
After upgrading from 7 -> 8 and after consulting the migration guide I came to the result that my way of getting my config variables is not supported anymore. But the migration guide does not tell me how the handle this issue. Let me outline the problem:
I create my Nest application with nest-winston as a logger and need to get the variables from my config:

``
``

Since createMicroservice does not allow to inject my config service, containing the redis config, I need to workaround this in this way:
As you can already see line 65 is red -> This is also stated in the migration guide, that startAllMicroservices does not have any argument. But also with .then()... I can not get this running again.
Also with app.listen -> not working because app is not a instance of INestMicroservices.
Here the error:

Here is the main HTTP Repo: https://github.com/Meywether/nestjs_http_sample -> working with Nest 8
Here is the main Microservice Repo in broken state with config service: https://github.com/Meywether/nestjs_ms1
May I kindly ask for your help ?
Thank you very much in advance!
Minimum reproduction code
https://github.com/Meywether/nestjs_ms1 and https://github.com/Meywether/nestjs_http_sample
Input code
Expected behavior
Help to develop a different approach to inject config service.
Other
No response
Update: 05.12.2021- Nest 8 and Nest 7 communication via redis is also not possible due to redis 4 @ nest 8 and redis 3 @nest 7 updated depency of the main repo to cover this.
Update 05.12.2021 - Found an open discussion about a similar context. I think this one is related:
#2343
The text was updated successfully, but these errors were encountered: