Puppeteer script suddenly stopped working after upgrading Puppeteer - chromium

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

Vue error when creating a project from Vue CLI

After I create a Vue3 project with the Vue cli tool, my terminal crashes and gives the following error:
πŸš€ Starting GUI...
🌠 Ready on http://localhost:8000
node:events:368
throw er; // Unhandled 'error' event
^
Error: ENOENT: no such file or directory, scandir '/Users/xxxx/Desktop/personal/vuetest/node_modules/#vue/cli-service/locales'
at Object.readdirSync (node:fs:1390:3)
at exports.readdir (/usr/local/lib/node_modules/#vue/cli/node_modules/#mrmlnc/readdir-enhanced/lib/sync/fs.js:18:20)
at Object.safeCall [as safe] (/usr/local/lib/node_modules/#vue/cli/node_modules/#mrmlnc/readdir-enhanced/lib/call.js:24:8)
at DirectoryReader.readNextDirectory (/usr/local/lib/node_modules/#vue/cli/node_modules/#mrmlnc/readdir-enhanced/lib/directory-reader.js:78:10)
at Readable.DirectoryReader.stream._read (/usr/local/lib/node_modules/#vue/cli/node_modules/#mrmlnc/readdir-enhanced/lib/directory-reader.js:57:18)
at Readable.read (node:internal/streams/readable:496:27)
at readdirSync (/usr/local/lib/node_modules/#vue/cli/node_modules/#mrmlnc/readdir-enhanced/lib/sync/index.js:27:21)
at Function.readdirSyncStat (/usr/local/lib/node_modules/#vue/cli/node_modules/#mrmlnc/readdir-enhanced/lib/index.js:34:10)
at ReaderSync.dynamicApi (/usr/local/lib/node_modules/#vue/cli/node_modules/fast-glob/out/providers/reader-sync.js:64:24)
at ReaderSync.api (/usr/local/lib/node_modules/#vue/cli/node_modules/fast-glob/out/providers/reader-sync.js:56:25)
Emitted 'error' event on Readable instance at:
at emitErrorNT (node:internal/streams/destroy:164:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
syscall: 'scandir',
code: 'ENOENT',
path: '/Users/xxxx/Desktop/personal/vuetest/node_modules/#vue/cli-service/locales'
}
Node.js v17.0.1
I cannot start the cli again until I delete the project folder. What is the problem here ?

TypeError: undefined is not a function, js engine: hermes

My React Native (0.66.3) app today pops up an error with a stable code which hasn't had any change for quite some time. It is on macOS Big Sur. Here is the error:
ERROR TypeError: undefined is not a function, js engine: hermes
Error: ENOENT: no such file or directory, open '/Users/macair/Documents/code/js/xyz_app5/http:/localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.xyz-app5'
at Object.openSync (fs.js:498:3)
at Object.readFileSync (fs.js:394:35)
at getCodeFrame (/Users/macair/Documents/code/js/xyz_app5/node_modules/metro/src/Server.js:919:18)
at Server._symbolicate (/Users/macair/Documents/code/js/xyz_app5/node_modules/metro/src/Server.js:992:22)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Server._processRequest (/Users/macair/Documents/code/js/xyz_app5/node_modules/metro/src/Server.js:403:7) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/Users/macair/Documents/code/js/xyz_app5/http:/localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.xyz-app5'
}
Here is the error displayed on IOS simulator:
The error seems related to metro in React Native.
Reinstall node_modules
rm -rf node_modules
Clean your cache
yarn cache clean (or npm cache clean –force)

Running "vue ui" on Windows Subsystem For Linux (WSL) will not work

An error will get generated when running:
vue ui
vue ui
πŸš€ Starting GUI...
🌠 Ready on http://localhost:8001
events.js:287
throw er; // Unhandled 'error' event
^
Error: spawn cmd.exe ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd.exe',
path: 'cmd.exe',
spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:8001' ]
}
Expected to get an app running on port localhost:8001, but the above error gets generated.
The reason is because it is trying to open a browser window from inside WSL terminal.
Instead, do the following:
vue ui --headless
This will avoid running the cmd.exe to open a browser and instead run the app on port 8001. You'll have to open a browser manually to http://localhost:8001

Error: getaddrinfo EAI_AGAIN undefined (ldapjs)

So, i tried to deploy my Express.Js app to my vps, but I get some error that refined to Error: getaddrinfo EAI_AGAIN undefined. The weird part is, it is doing just fine if I run this app on my localhost. Any body knows how to resolve this issue?
Here are the error log that I get.
events.js:187
throw er; // Unhandled 'error' event
^
Error: getaddrinfo EAI_AGAIN undefined
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26)
Emitted 'error' event on Client instance at:
at Backoff.<anonymous> (/home/user/deploy-folder/app-api/node_modules/ldapjs/lib/client/client.js:1228:12)
at Backoff.emit (events.js:210:5)
at Backoff.backoff (/home/user/deploy-folder/app-api/node_modules/ldapjs/node_modules/backoff/lib/backoff.js:41:14)
at /home/user/deploy-folder/app-api/node_modules/ldapjs/lib/client/client.js:1214:15
at f (/home/user/deploy-folder/app-api/node_modules/ldapjs/node_modules/once/once.js:25:25)
at Socket.onResult (/home/user/deploy-folder/app-api/node_modules/ldapjs/lib/client/client.js:1016:7)
at Object.onceWrapper (events.js:300:26)
at Socket.emit (events.js:210:5)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) {
errno: 'EAI_AGAIN',
code: 'EAI_AGAIN',
syscall: 'getaddrinfo',
hostname: 'undefined'
I assume that by now you discovered the error, but in this particular case it seems that the variable you are using to setup ldap is not stated or resolves to undefined.
The proper way to do it according to the documentation is this:
var ldap = require('ldapjs');
var client = ldap.createClient({
url: 'ldap://127.0.0.1:1389'
});

React Packager 0.44.0

First of all I am new to react native platform and I am developing an app but I am facing one issue when I run my application after changes made in classes.
I am posting my logs below, Thank you for your help folks....
index.android.js (loads successfully but app do not run)
SyntaxError: Unexpected end of JSON input
at parse (<anonymous>)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
SyntaxError: Unexpected end of JSON input
at parse (<anonymous>)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
{
Error: write EPIPE
at _errnoException (util.js:1022:11)
at Socket._writeGeneric (net.js:767:25)
at Socket._write (net.js:786:8)
at doWrite (_stream_writable.js:387:12)
at writeOrBuffer (_stream_writable.js:373:5)
at Socket.Writable.write (_stream_writable.js:290:11)
at Socket.write (net.js:704:40)
at Socket.Writable.end (_stream_writable.js:553:10)
at Socket.end (net.js:496:31)
at Promise.resolve.then.then.then.catch.then.message
(E:\FinalDownload\takeawaymobileapp\node_modules\react-native\packager\src\Server\symbolicate\worker.js
:35:33) code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }