webstorm报错TypeError: this.cliEngine is not a constructor

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了webstorm报错TypeError: this.cliEngine is not a constructor相关的知识,希望对你有一定的参考价值。

参考技术A TypeError: this.cliEngine is not a constructor

    at ESLintPlugin.invokeESLint (/Applications/RubyMine.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js:97:25)

    at ESLintPlugin.getErrors (/Applications/RubyMine.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js:76:21)

    at ESLintPlugin.onMessage (/Applications/RubyMine.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js:42:29)

    at Interface.<anonymous> (/Applications/RubyMine.app/Contents/plugins/JavaScriptLanguage/jsLanguageServicesImpl/js-language-service.js:105:39)

    at Interface.emit (events.js:189:13)

    at Interface._onLine (readline.js:290:10)

    at Interface._normalWrite (readline.js:433:12)

    at Socket.ondata (readline.js:149:10)

    at Socket.emit (events.js:189:13)

    at addChunk (_stream_readable.js:284:12)

Process finished with exit code -1

需要修改这个文件

/Applications/WebStorm.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js

“Ctrl+F”填写“lib/cli-engine”找到

 this.cliEngine = require(packagePath + "lib/cli-engine");

在后面添上‘.CLIEngine’,即

this.cliEngine =require(packagePath +"lib/cli-engine").CLIEngine;

然后重启webstorm,OK,搞定。

使用reactantd组件报错TypeError: _this.formRef.current.validateFields is not a function

先说一下我的报错场景:
从抽屉里面提取出了一个form表单作为公共组件,这就涉及到了两个组件之间的通信问题,公共组件是一个选择框,抽屉有一个提交按钮,其中需要将选择框中的数据和提交方法都传递给公共组件,使按下提交按钮之后选择框的内容也调用提交的方法存入数据库中。
报错内容:

这里我传参的时候将参数命名为了ref,系统判定ref不是一个参数,修改ref为其他命名之后就可以了。

以上是关于webstorm报错TypeError: this.cliEngine is not a constructor的主要内容,如果未能解决你的问题,请参考以下文章

Uncaught TypeError: Cannot set properties of undefined (setting ‘XXX‘) 报错

Vue ElementUI Axios报错: Uncaught (in promise) TypeError: Cannot read property '$message' of u

配置webpack loader vue 报错:Module build failed: TypeError: this._init is not a function

使用reactantd组件报错TypeError: _this.formRef.current.validateFields is not a function

使用reactantd组件报错TypeError: _this.formRef.current.validateFields is not a function

使用reactantd组件报错TypeError: _this.formRef.current.validateFields is not a function