-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Nestjs-cls is invalid in the Nest App of nx [twists and turns] #19842
Comments
This is ultimately a problem with NestJS itself, see mentioned issue and this NestJS issue. |
Thank you, thank you very much for your answer. I can finally let go of my heart that has been hanging in suspense for the past two days. |
It is found in the above clues that it has been solved in nestjs. Is that a bug in nx? |
It is not a bug in NX, but in NestJS. You did not encounter it, because you did not use global prefix withou NX. If you did, you would find the same issue. |
Oh, yes, I forgot. In my actual project, I set GlobalPrefix, but it was not set in the demo I provided. Okay, thank you for your reminder |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
I have a project based on nx-v16.x that has been developed for a long time;
Previously, Nestjs-cls was introduced and everything was functioning normally;
When I added the Nest app to the project, the same reusable code, Nestjs-cls, became invalid. Even copying the previous project from the apps was invalid. As of now, the dependency removal and reinstallation, which used to work well, are no longer effective;
In order to ensure that it is my project issue, Nestjs-cls issue, or nx issue, I created two warehouses respectively. One is a pure project generated based on NesCli, and the other is a project based on the current nx-v17-- preset=nest. They only introduced Nestjs-cls, and ultimately found that NestCli's is OK, while nx's is still invalid;
Expected Behavior
I hope Nestjs-cls can be used normally in Nest of nx
GitHub Repo
No response
Steps to Reproduce
https://github.com/sailengsi/nest-cls_ok ● Project based on nest-cli
https://github.com/sailengsi/nx-nest-cls_bug ● Next project based on nx;
Both of the above two projects were exclusively, and only nestjs-cls were introduced in app.module.ts, and getId using ClsService in app.controller.ts was deleted by Console, since the input of nx projects was always undefined.
Nx Report
Failure Logs
No response
Package Manager Version
pnpm 8.5.1
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: