![](/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.