[英]I'm getting an error for an unrecognized function within Auth0's node package, specifically in their AuthenticationClient and ManagementClient API
Here is a picture of the error. 这是错误的图片。
I went into the package and found the exact function the error says is unrecognized 我进入包装, 发现错误的确切功能无法识别
import { Injectable } from '@nestjs/common';
import uuid from 'uuid/v4';
import { AuthenticationClient, ManagementClient } from 'auth0';
import { EnvConfig } from '../my/env/config';
const config = {
domain: EnvConfig.AUTH0_DOMAIN,
clientId: EnvConfig.AUTH0_CLIENT_ID,
clientSecret: EnvConfig.AUTH0_CLIENT_SECRET,
audience: `https://${EnvConfig.AUTH0_DOMAIN}/api/v2/`,
};
@Injectable()
export class Auth0Service {
public authenticationClient;
public managementClient;
constructor() {
this.authenticationClient = AuthenticationClient(config);
this.managementClient = ManagementClient(config);
}
The error occurs upon the instantiation of both AuthenticationClient and ManagementClient. 实例化AuthenticationClient和ManagementClient时发生错误。 I've been using a boilerplate system for setting up any third party services and have never seen a function unrecognized. 我一直在使用样板系统来设置任何第三方服务,但从未见过无法识别的功能。 I've tried to reinstall the package but had no luck. 我试图重新安装该软件包,但没有运气。
Any ideas as to what is going on? 有什么想法吗?
Thank you in advance. 先感谢您。
Turns out I'm blind and didn't see my lack of "new" next to my attempted instantiation.. 事实证明,我是盲人,在尝试实例化的旁边没有看到缺少“新”字符的情况。
(wrong)
this.authenticationClient = AuthenticationClient(config);
(correct)
this.authenticationClient = new AuthenticationClient(config);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.