我正在嘗試在 create-react-app 應(yīng)用程序中導(dǎo)入 got ( https://www.npmjs.com/package/got ),而當(dāng)我只是嘗試將其導(dǎo)入一個(gè)文件時(shí),甚至沒(méi)有嘗試執(zhí)行任何代碼應(yīng)用程序無(wú)法編譯,我收到以下錯(cuò)誤:util.js:601 Uncaught TypeError: The "original" argument must be of type Function at Object.promisify (util.js:601) at Object.<anonymous> (get-body-size.js:7) at Object../node_modules/got/dist/source/utils/get-body-size.js (get-body-size.js:30) at __webpack_require__ (bootstrap:784) at fn (bootstrap:150) at Object.<anonymous> (normalize-arguments.js:15) at Object../node_modules/got/dist/source/normalize-arguments.js (normalize-arguments.js:441) at __webpack_require__ (bootstrap:784) at fn (bootstrap:150) at Object.<anonymous> (as-promise.js:8) at Object../node_modules/got/dist/source/as-promise.js (as-promise.js:152) at __webpack_require__ (bootstrap:784) at fn (bootstrap:150) at Object../node_modules/got/dist/source/create.js (create.js:4) at __webpack_require__ (bootstrap:784) at fn (bootstrap:150) at Object../node_modules/got/dist/source/index.js (index.js:7) at __webpack_require__ (bootstrap:784) at fn (bootstrap:150) at Object../src/utils/ph_loader.js (ph_loader.js:1) at __webpack_require__ (bootstrap:784) at fn (bootstrap:150) at Module../src/components/Video.jsx (Searchbar.jsx:3) at __webpack_require__ (bootstrap:784) at fn (bootstrap:150) at Module../src/App.js (src sync:9) at __webpack_require__ (bootstrap:784) at fn (bootstrap:150) at Module../src/index.js (index.css?f3f6:45) at __webpack_require__ (bootstrap:784) at fn (bootstrap:150) at Object.1 (ph_loader.js:21) at __webpack_require__ (bootstrap:784) at checkDeferredModules (bootstrap:45) at Array.webpackJsonpCallback [as push] (bootstrap:32) at main.chunk.js:1PS:我正在使用最新版本的 create-react-app 和最新版本的 got。
嘗試導(dǎo)入 npm 時(shí)出錯(cuò),進(jìn)入 create-react-app
牛魔王的故事
2022-06-05 16:34:30