Skip to content
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

Closed
1 of 4 tasks
sailengsi opened this issue Oct 25, 2023 · 7 comments
Closed
1 of 4 tasks

Nestjs-cls is invalid in the Nest App of nx [twists and turns] #19842

sailengsi opened this issue Oct 25, 2023 · 7 comments
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx stale type: bug

Comments

@sailengsi
Copy link

sailengsi commented Oct 25, 2023

Current Behavior

  1. I have a project based on nx-v16.x that has been developed for a long time;

  2. Previously, Nestjs-cls was introduced and everything was functioning normally;

  3. 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;

  4. 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

  1. https://github.com/sailengsi/nest-cls_ok ● Project based on nest-cli

  2. 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

No abnormal output

Failure Logs

No response

Package Manager Version

pnpm 8.5.1

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@Papooch
Copy link

Papooch commented Oct 25, 2023

This is ultimately a problem with NestJS itself, see mentioned issue and this NestJS issue.

@AgentEnder AgentEnder added the scope: node Issues related to Node, Express, NestJS support for Nx label Oct 25, 2023
@sailengsi
Copy link
Author

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.

@sailengsi
Copy link
Author

It is found in the above clues that it has been solved in nestjs. Is that a bug in nx?

@Papooch
Copy link

Papooch commented Oct 26, 2023

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.

@sailengsi
Copy link
Author

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

Copy link

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.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@github-actions github-actions bot added the stale label Apr 24, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx stale type: bug
Projects
None yet
Development

No branches or pull requests

3 participants