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

Error with ProxyProvider in nestjs-cls #200

Open
Natashkinsasha opened this issue Jan 19, 2025 · 2 comments
Open

Error with ProxyProvider in nestjs-cls #200

Natashkinsasha opened this issue Jan 19, 2025 · 2 comments
Labels
investigation Why is this happening? needs info Waiting for more information from the OP stale The solution hasn't moved forward in a while

Comments

@Natashkinsasha
Copy link

Problem Description

I am trying to create a simple ProxyProvider using the nestjs-cls library, but I encounter an error during application startup:

Cannot access the property "constructor" on the proxy provider Test555 because it has not been resolved yet and has been registered with the "strict: true" option. Make sure to call "await cls.resolveProxyProviders()" before accessing the proxy provider.

Versions

  • nestjs-cls: ^4.5.0
  • Node.js: v18.20.0

Code Example

Here is a minimal code snippet that reproduces the issue:

import { InjectableProxy, ClsModule } from 'nestjs-cls';

@InjectableProxy({ strict: true })
export class TestProver {
  constructor() {}
}

ClsModule.forRoot({
  proxyProviders: [TestProver],
});
@Papooch
Copy link
Owner

Papooch commented Jan 20, 2025

Hi, thank you for the bug report, however, I am unable to reproduce the issue locally. both in the library's test suite or with a new clean project npx @nest/cli new.

My guess is that somewhere in your application, you're trying to access the Proxy provider's constructor directly.

To investigate this further, would you be able to provide a working minimal reproduction that demonstrates the issue?

@Papooch Papooch added investigation Why is this happening? needs info Waiting for more information from the OP labels Jan 20, 2025
@Papooch
Copy link
Owner

Papooch commented Jan 27, 2025

Hi @Natashkinsasha, last week I asked you for some reproduction code, as I'm not able to reproduce your issue with the code you've given.

Do you still encounter this issue, or have you solved it since?

@Papooch Papooch added the stale The solution hasn't moved forward in a while label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigation Why is this happening? needs info Waiting for more information from the OP stale The solution hasn't moved forward in a while
Projects
None yet
Development

No branches or pull requests

2 participants