简体   繁体   English

未捕获的类型错误:“原始”参数的类型必须为 Function

[英]Uncaught TypeError: The "original" argument must be of type Function

when I start the react application, using npm start , I am encountering this error, there are lot of questions around this error, but I am unable to understand the root cause of this error.当我使用npm start启动反应应用程序时,我遇到了这个错误,围绕这个错误有很多问题,但我无法理解这个错误的根本原因。 Please Explain.请解释。

Uncaught TypeError: The "original" argument must be of type Function
        at Object.promisify (util.js:601:1)
        at ./node_modules/env-cmd/dist/parse-rc-file.js (parse-rc-file.js:7:1)
        at __webpack_require__ (bootstrap:789:1)
        at fn (bootstrap:150:1)
        at ./node_modules/env-cmd/dist/get-env-vars.js (get-env-vars.js:3:1)
        at __webpack_require__ (bootstrap:789:1)
        at fn (bootstrap:150:1)
        at ./node_modules/env-cmd/dist/index.js (index.js:6:1)
        at __webpack_require__ (bootstrap:789:1)
        at fn (bootstrap:150:1)
        at ./src/components/layout_components/exec_layout/choicePageLayout.js (view-all-customers.svg:1:1)
        at __webpack_require__ (bootstrap:789:1)
        at fn (bootstrap:150:1)
        at ./src/components/layout_components/exec_layout/indexPageLayout.js (demoLayout.js:424:1)
        at __webpack_require__ (bootstrap:789:1)
        at fn (bootstrap:150:1)
        at ./src/components/layout_components/login/login.js (login.css?7228:45:1)
        at __webpack_require__ (bootstrap:789:1)
        at fn (bootstrap:150:1)
        at ./src/index.js (index.css?ac04:45:1)
        at __webpack_require__ (bootstrap:789:1)
        at fn (bootstrap:150:1)
        at 1 (helper.js:12:1)
        at __webpack_require__ (bootstrap:789:1)
        at checkDeferredModules (bootstrap:45:1)
        at Array.webpackJsonpC

It would be really helpful if you provide the code that is causing this error...如果您提供导致此错误的代码,那将非常有帮助...

My guess, after looking at the error would be, that you are calling some function somewhere in a parameter of another function at parse-rc-file.js:7:1 instead of passing the function directly.我的猜测是,在查看错误后,您在parse-rc-file.js:7:1的另一个 function 的参数中某处调用了一些 function,而不是直接传递 ZC1C425268E68385D1AB507。

eg: someFnExpectingACallback(myFunction()) instead of someFnExpectingACallback(myFunction)例如: someFnExpectingACallback(myFunction())而不是someFnExpectingACallback(myFunction)

Take a look at callback functions看看回调函数

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Vue.js 中的 googleapis:TypeError:“原始”参数必须是函数类型 - googleapis in Vue.js: TypeError: The "original" argument must be of type Function TypeError:“原始”参数必须是 Vue.js 应用程序中的 Function 类型 - TypeError: The "original" argument must be of type Function in Vue.js application “原始”参数的类型必须为 Function - The “original” argument must be of type Function TypeError [ERR_INVALID_ARG_TYPE]:“原始”参数的类型必须为 Function。接收到的类型未定义 - TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type Function. Received type undefined 接收 UnhandledPromiseRejectionWarning:TypeError [ERR_INVALID_ARG_TYPE]:“原始”参数必须是 function 类型 - Receiving UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function TypeError [ERR_INVALID_ARG_TYPE]:“原始”参数必须是 function 类型 - TypeError [ERR_INVALID_ARG_TYPE]: The “original” argument must be of type function 使用promisify的节点回调样式? “'原始'参数必须是类型函数” - Node callback style with promisify? “The 'original' argument must be of type function” “原始”参数必须是 function 类型。接收到 Object 的实例 - The "original" argument must be of type function. Received an instance of Object TypeError:“callback”参数必须是一个函数 - TypeError: “callback” argument must be a function TypeError('"listener" 参数必须是一个函数'); - TypeError('"listener" argument must be a function');
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM