![](/img/trans.png)
[英]Uncaught TypeError: Cannot read property 'addEventListener' of null when i try to run my code in chrome
[英]What is the TypeError: require(…)(…) is not a function when I try to run my playWright script?
我目前正在將部分自動化腳本移動到不同的文件中,以便更輕松地維護整個腳本,我遇到了這個問題。
$ node ./playWright/index
D:\Lambda\projects\puppeteer_test\playWright\index.js:6
})();
^
TypeError: require(...)(...) is not a function
at Object.<anonymous> (D:\Lambda\projects\puppeteer_test\playWright\index.js:6:3)
將您的 index.js 啟動 function 從
(async () => { // Start of async arrow function
// Function code
// ...
})(); // End of the function and () to invoke itself
到一個正常的異步 function
async function index() {
await downloadFile()
console.log("Test")
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.