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

[Nest] Class constructor MixinStrategy cannot be invoked without 'new' #27

Closed
ViktoriaShelestenko opened this issue Jan 11, 2019 · 5 comments

Comments

@ViktoriaShelestenko
Copy link

ViktoriaShelestenko commented Jan 11, 2019

Hello. Can you please direct me on right way of understanding this error.


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

import { OIDCStrategy } from 'passport-azure-ad';
import { PassportStrategy } from '@nestjs/passport';


@Injectable()
export class MyStrategy extends PassportStrategy(OIDCStrategy, 'azuread-openidconnect') {

  constructor(private readonly authService: AuthService) {
    super (
      {identityMetadata: config.identityMetadata,...},
      (req, iss, sub, profile, jwtClaims, access_token, refresh_token, params, done) => {....}
    );
  }
}

And i got fail on string where "super (" is written
[Nest] Class constructor MixinStrategy cannot be invoked without 'new'

@ViktoriaShelestenko
Copy link
Author

Hey guys. If you have same issue - i have solving.
In typescript.json replace your target with folowing:


"target": "esnext",

Hope it works for you.

@kamilmysliwiec
Copy link
Member

Thanks for sharing your solution :)

@CWSpear
Copy link

CWSpear commented Apr 9, 2019

When I use hmr via the Nest docs and try to run the webpack server, I am still getting this error. Changing my tsconfig.json target to esnext doesn't seem to affect the webpack output.

@atul221282
Copy link

atul221282 commented May 10, 2019

Changing this fix the issue but then this code start throwing an error with typeorm many to many relationship error. The error it is giving is circular dependency issue. I am using nestjs and typeorm using nrwl extension

@Fasunle
Copy link

Fasunle commented Oct 2, 2022

changing my target to ES2019 solves the problem. Thank you, for sharing.

@nestjs nestjs locked and limited conversation to collaborators Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants