首页 > 解决方案 > 修复导入错误和 TypeError: ActiveDirectory is not a constructor

问题描述

我想在 Vue.js Web 应用程序中使用活动目录,但是一旦安装了模块,我尝试运行我的应用程序会出现几个错误......

安装模块后: npm install activedirectory --save 我确实有一个带有登录名/密码的表单,当我提交时,启动了 activedirectory 模块:

var ActiveDirectory = require("activedirectory");
var config = {
host: "147.156.182.39",
port: "452",
baseDN: "dc=juice,dc=fr",
username: "anfinsol_save@juice.fr",
password: "password123"
};

首次单击时出错:[Vue 警告]:v-on 处理程序中的错误:“TypeError:未知流类型“未定义””

在发现

---> <AthentComponent> at src/components/subcomponents/AuthentComponent.vue
<MainPage> at src/views/Accueil.vue
<App> at src/App.vue
<Root> vue.runtime.esm.js:619
VueJS 7
TypeError: "unknown stream type "undefined""
addStream bunyan.js:620
Logger bunyan.js:470
Logger bunyan.js:469
createLogger bunyan.js:1618
<anonymous> activedirectory.js:16
<anonymous> activedirectory.js:1901
js app.js:925
__webpack_require__ app.js:767
fn app.js:130
<anonymous> index.js:1
js app.js:914
__webpack_require__ app.js:767
fn app.js:130
submit AuthentComponent.vue:52

第二次点击错误:

[Vue warn]: Error in v-on handler: "TypeError: ActiveDirectory is not a constructor"

found in

---> <AthentComponent> at src/components/subcomponents/AuthentComponent.vue
<MainPage> at src/views/Accueil.vue
<App> at src/App.vue
<Root> vue.runtime.esm.js:619
TypeError: "ActiveDirectory is not a constructor"
submit AuthentComponent.vue:57
VueJS 3

正确使用activedirectory没有错误,我已经尝试了几个版本并卸载/安装模块但仍然无法正常工作。

标签: javascriptnode.jsvue.jsactive-directory

解决方案


推荐阅读