简体   繁体   English

我在Auth0的节点程序包中,特别是在他们的AuthenticationClient和ManagementClient API中收到无法识别的函数错误

[英]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.

相关问题 Auth0 Postgresql 出现错误 - this._connectionCallback 不是 function - Auth0 Postgresql getting error - this._connectionCallback is not a function Lambda function 未通过 Auth0 node-auth0 SDK 调用 auth0 方法 - Lambda function not calling auth0 methods via Auth0 node-auth0 SDK 在Promise中包装Auth0的parseHash函数 - Wrapping Auth0's parseHash function in a Promise Heroku / Auth0 Android + JAVA API错误 - Heroku/Auth0 Android + JAVA API Error 如何在我的 API 上返回来自 Auth0 的 API 的响应数据? - How can I return the response data from Auth0's API on my API? 从 API 中访问 Auth0 登录用户? - Accessing Auth0 logged in user from within an API? 使用 Auth0 使用 NextJS 应用程序获取 ECONNREFUSED 调用外部 API - Getting ECONNREFUSED calling an external API with NextJS application using Auth0 为什么我收到错误“错误:语法错误,无法识别的表达式:不支持的伪:选择”? - Why I'm getting the error “Error: Syntax error, unrecognized expression: unsupported pseudo: select”? 我正在尝试创建一个表,但我不断收到错误:属性“postagens.titulo”的无法识别的数据类型 - I'm trying to create a table but i keep getting Error: Unrecognized datatype for attribute "postagens.titulo" 在 React 我得到 this.setState is not a function 错误在 setTimeout/setInterval - In React i'm getting this.setState is not a function error within setTimeout/setInterval
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM