I have a puppeteer script I run to reboot my modem. It has worked for I guess about a year with no problem. 5 days ago it stopped working. I was looking into it and realized that I am getting errors I didn't used to get when running it and the script fails. The thing is I didn't change anything. As far as I can see, the HTML hasn't changed either yet it is failing. So I wonder if there is a bug in chromium or puppeteer or if it handles things differently somehow?
Here's a codepen with https://codepen.io/michaelbierman/pen/qQjdYR
HTML page
puppeteer script
errors
ERROR OUTPUT
Thursday 11/15/2018 11:14:04, Login...
Unhandled Rejection at: Promise (new page) Promise {
Error: No node found for selector: #id_username
at assert (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:278:11)
at Frame.type (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/FrameManager.js:771:5)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
-- ASYNC --
at Frame. (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:144:27)
at Page.type (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/Page.js:971:29)
at /Users/bierman/Documents/Applications/bin/arris/arristest.js:49:13
at
at process._tickCallback (internal/process/next_tick.js:188:7) } reason: Error: No node found for selector: #id_username
at assert (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:278:11)
at Frame.type (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/FrameManager.js:771:5)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
-- ASYNC --
at Frame. (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:144:27)
at Page.type (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/Page.js:971:29)
at /Users/bierman/Documents/Applications/bin/arris/arristest.js:49:13
at
at process._tickCallback (internal/process/next_tick.js:188:7)
/Users/bierman/Documents/Applications/bin/arris/arristest.js:29
browser.close();
^
ReferenceError: browser is not defined
at process.on (/Users/bierman/Documents/Applications/bin/arris/arristest.js:29:2)
at emitTwo (events.js:126:13)
at process.emit (events.js:214:7)
at emitPendingUnhandledRejections (internal/process/promises.js:108:22)
at process._tickCallback (internal/process/next_tick.js:189:7)
BigMac:bin michael$ /usr/local/bin/node /Users/bierman/Documents/Applications/bin/arris/arristest.js
Thursday 11/15/2018 11:20:29, Login...
Thursday 11/15/2018 11:20:36, Go to home...
Unhandled Rejection at: Promise (new page) Promise {
Error: No node found for selector: #alertExitButton
at assert (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:278:11)
at Frame.click (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/FrameManager.js:704:5)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
-- ASYNC --
at Frame. (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:144:27)
at Page.click (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/Page.js:932:29)
at /Users/bierman/Documents/Applications/bin/arris/arristest.js:62:13
at
at process._tickCallback (internal/process/next_tick.js:188:7) } reason: Error: No node found for selector: #alertExitButton
at assert (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:278:11)
at Frame.click (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/FrameManager.js:704:5)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
-- ASYNC --
at Frame. (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:144:27)
at Page.click (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/Page.js:932:29)
at /Users/bierman/Documents/Applications/bin/arris/arristest.js:62:13
at
at process._tickCallback (internal/process/next_tick.js:188:7)
/Users/bierman/Documents/Applications/bin/arris/arristest.js:29
browser.close();
^
ReferenceError: browser is not defined
at process.on (/Users/bierman/Documents/Applications/bin/arris/arristest.js:29:2)
at emitTwo (events.js:126:13)
at process.emit (events.js:214:7)
at emitPendingUnhandledRejections (internal/process/promises.js:108:22)
at process._tickCallback (internal/process/next_tick.js:189:7)
Try this:
npm uninstall chromium
npm uninstall puppeteer
npm i chromium#1
npm i puppeteer
Related
I downloaded a bot that periodically modifies the Minecraft server status on Discord from Github, and this error pops up. How can I fix it?
C:\Users\Administrator\Downloads\minecraft-bot-main\events\interactionCreate.js:4
if (interaction.type !== InteractionType.ApplicationCommand) return;
^
TypeError: Cannot read properties of undefined (reading 'ApplicationCommand')
at module.exports (C:\Users\Administrator\Downloads\minecraft-bot-main\events\interactionCreate.js:4:46)
at Client.emit (node:events:513:28)
at InteractionCreateAction.handle (C:\Users\Administrator\Downloads\minecraft-bot-main\node_modules\discord.js\src\client\actions\InteractionCreate.js:83:12)
at module.exports [as INTERACTION_CREATE] (C:\Users\Administrator\Downloads\minecraft-bot-main\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\Administrator\Downloads\minecraft-bot-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:346:31)
at WebSocketShard.onPacket (C:\Users\Administrator\Downloads\minecraft-bot-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:478:22)
at WebSocketShard.onMessage (C:\Users\Administrator\Downloads\minecraft-bot-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:317:10)
at callListener (C:\Users\Administrator\Downloads\minecraft-bot-main\node_modules\ws\lib\event-target.js:290:14)
at WebSocket.onMessage (C:\Users\Administrator\Downloads\minecraft-bot-main\node_modules\ws\lib\event-target.js:209:9)
at WebSocket.emit (node:events:513:28)
Node.js v18.8.0
Reinstall node 18.14.0 to 18.8.0 and command 'npm insatll'
I keep getting errors with Gridsome starters when executing the gridsome develop command.
I've tried the default starter that Grisdome recommends and now the Contentful Starter so far and errors keep showing up in the terminal.
Here is the error I get with the Contentful starter:
Initializing plugins...
Error: Request failed with status code 404
at createError (/var/www/public/my-project/node_modules/contentful/dist/contentful.node.js:886:15)
at settle (/var/www/public/my-project/node_modules/contentful/dist/contentful.node.js:1049:12)
at Unzip.handleStreamEnd (/var/www/public/my-project/node_modules/contentful/dist/contentful.node.js:294:11)
at Unzip.emit (events.js:215:7)
at endReadableNT (_stream_readable.js:1183:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
And here is the error from the default starter:
Error
at afterWriteDispatched (internal/stream_base_commons.js:150:25)
at writeGeneric (internal/stream_base_commons.js:141:3)
at Socket._writeGeneric (net.js:770:11)
at Socket._write (net.js:782:8)
at doWrite (_stream_writable.js:431:12)
at writeOrBuffer (_stream_writable.js:415:5)
at Socket.Writable.write (_stream_writable.js:305:11)
at Socket.Writable.end (_stream_writable.js:594:10)
at Socket.end (net.js:574:31)
at handleInput (/var/www/public/myblog/node_modules/imagemin-pngquant/node_modules/execa/index.js:87:17)
When i tried to installing protractor in my office PC, I am getting stuck at the step 'webdriver-manager update' in the command terminal.I did not face this obstacle when I tried the command in my personal laptop.The error thrown is as below,
C:\Users\616356>webdriver-manager update
[10:45:09] I/config_source - curl -o C:\Users\616356\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\standalone-response.xml
https://selenium-release.storage.googleapis.com/
[10:45:09] I/config_source - curl -o C:\Users\616356\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\chrome-response.xml
https://chromedriver.storage.googleapis.com/
[10:45:09] I/config_source - curl -o C:\Users\616356\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\gecko-response.json
https://api.github.com/repos/mozilla/geckodriver/releases
events.js:165
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED 172.217.166.112:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1174:14)
Emitted 'error' event at:
at Request.onRequestError (C:\Users\616356\AppData\Roaming\npm\node_modules\protractor\node_modules\request\request.js:881:8)
at ClientRequest.emit (events.js:185:15)
at TLSSocket.socketErrorListener (_http_client.js:395:9)
at TLSSocket.emit (events.js:180:13)
at emitErrorNT (internal/streams/destroy.js:64:8)
at process._tickCallback (internal/process/next_tick.js:178:19)
I think the issue might be regarding some firewall or proxy problem.I tried adding 172.217.166.112 in the proxy exceptions, it didn't work.I just don't know how to resolve this issue.Any suggestions would be appreciated.
example like this
webdriver-manager update --proxy http://TPESproxy.galileo.corp.lcl:8980
I'm facing an issue with discordjs and i don't understand it. I run "node main.js" into a linux screen, detach it, go to sleep and when i come back, it crashed. Could you enlight me ?
# screen -r BotApex
(node:6559) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
events.js:180
throw err; // Unhandled 'error' event
^
Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
at Client.emit (events.js:178:17)
at WebSocketConnection.onError (/root/ApexLegendsSnipeBot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:374:17)
at WebSocket.onError (/root/ApexLegendsSnipeBot/node_modules/ws/lib/event-target.js:128:16)
at WebSocket.emit (events.js:189:13)
at _receiver.cleanup (/root/ApexLegendsSnipeBot/node_modules/ws/lib/websocket.js:211:14)
at Receiver.cleanup (/root/ApexLegendsSnipeBot/node_modules/ws/lib/receiver.js:557:13)
at WebSocket.finalize (/root/ApexLegendsSnipeBot/node_modules/ws/lib/websocket.js:206:20)
at TLSSocket.emit (events.js:189:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
Looks like your bot ran into an error event while you were away. If you don't handle error events they usually make your bot crash. To prevent the bot from crashing, simply add an error listener:
client.on("error", info => {
console.log('Error event:\n' + JSON.stringify(info));
// handle the error here
});
Please keep in mind that the error event has been called for some reason and that you should handle the error afterwards.
I'm struggling to get node-huxley to run. Having installed it globally, I then installed the node-selenium driver, cloned the repo and tried to run Huxley on the examples. However I'm seeing this error.
It seems to suggest that the server isn't running, but I've verified it as running on localhost:8000 correctly. Any ideas how to debug this?
firefox opening.
At 1 type and toggle.hux
/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/lib/webdriver/promise.js:1549
throw error;
^
Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.<anonymous> (/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/http/index.js:127:16)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1547:9)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:415:13)
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:49)
at Function.webdriver.WebDriver.createSession (/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:111:30)
at Builder.build (/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/builder.js:105:20)
at _open (/usr/local/lib/node_modules/huxley/source/browser/driver.js:28:6)
at Object.open (/usr/local/lib/node_modules/huxley/source/browser/driver.js:49:3)
at _openRunAndClose (/usr/local/lib/node_modules/huxley/index.js:76:11)
at /usr/local/lib/node_modules/huxley/index.js:169:5
at /usr/local/lib/node_modules/huxley/index.js:217:5
at /usr/local/lib/node_modules/huxley/source/playback/getPlaybackInfos.js:121:5
Have you started selenium? (https://github.com/chenglou/node-huxley#installation)