whatsapp web gadd called without an id attr (id) - node.js

I am getting error while executing following function in whatsapp web
Function:
const data = window.Store.Presence.find(chatId);
Error:
/home/sariful/Public/whatappApi/files/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221
throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
^
Error: Evaluation failed: Error: gadd called without an id attr (id)
at p.gadd (https://web.whatsapp.com/bootstrap_qr.a93ca7c63be0f2cdef56.js:71:532289)
at https://web.whatsapp.com/bootstrap_qr.a93ca7c63be0f2cdef56.js:71:653775
at Generator.next (<anonymous>)
at t (https://web.whatsapp.com/vendor1~bootstrap_qr.27ae36d14a5e15ff6df9.js:2:65356)
at s (https://web.whatsapp.com/vendor1~bootstrap_qr.27ae36d14a5e15ff6df9.js:2:65567)
at https://web.whatsapp.com/vendor1~bootstrap_qr.27ae36d14a5e15ff6df9.js:2:65626
at Y (https://web.whatsapp.com/bootstrap_qr.a93ca7c63be0f2cdef56.js:31:99298)
at new y (https://web.whatsapp.com/bootstrap_qr.a93ca7c63be0f2cdef56.js:31:91865)
at https://web.whatsapp.com/vendor1~bootstrap_qr.27ae36d14a5e15ff6df9.js:2:65507
at p._find (https://web.whatsapp.com/bootstrap_qr.a93ca7c63be0f2cdef56.js:71:653867)
at ExecutionContext._evaluateInternal (/home/sariful/Public/whatappApi/files/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ExecutionContext.evaluate (/home/sariful/Public/whatappApi/files/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)

Related

I keep running into the same error after trying to run Node User routes

I keep getting an error in my express-promise-router
var wrapHandler = function (handler) {if ("function" !== typeof handler) { var type = Object.prototype.toString.call(handler); var msg = "Expected a callback function but got a " + type; throw new Error(msg); } var handleReturn = function (args) { // Find the next function from the arguments var next = args.slice(-1)[0];
`Error is as follows:-
node_modules/express-promise-router/lib/express-promise-router.js:10
throw new Error(msg);
^`
Error: Expected a callback function but got a [object Undefined]
at /Users/alfredbanda/jobplus-backend/node_modules/express-promise-router/lib/express-promise-router.js:104:16 at Array.map (<anonymous>) at instanceToWrap.<computed> [as post] (/Users/alfredbanda/jobplus-backend/node_modules/express-promise-router/lib/express-promise-router.js:103:32) at Object.<anonymous> (/Users/alfredbanda/jobplus-backend/src/routes/auth.routes.js:4:8) at Module._compile (node:internal/modules/cjs/loader:1239:14) at Module._extensions..js (node:internal/modules/cjs/loader:1293:10) at Module.load (node:internal/modules/cjs/loader:1096:32) at Module._load (node:internal/modules/cjs/loader:935:12) at Module.require (node:internal/modules/cjs/loader:1120:19)
Node.js v19.4.0
[nodemon] app crashed - waiting for file changes before starting...
I know there is a problem with the callback function being passed to the "express-promise-router" module. Specifically, the error message says that it expected a callback function, but instead got an object of type "Undefined". I checked the function call and ensured that the correct callback function is being passed as an argument but to no avail.

TypeError: Cannot read properties of undefined (reading 'create') - Module "soap"

I have a soap xml api project but I can't use soap module.
enter image description here`
error - TypeError: Cannot read properties of undefined (reading 'create')
at new HttpClient (C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\soap\lib\http.js:40:59)
at Object.open_wsdl (C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\soap\lib\wsdl\index.js:1270:48)
at openWsdl (C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\soap\lib\soap.js:70:16)
at C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\soap\lib\soap.js:48:13
at _requestWSDL (C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\soap\lib\soap.js:76:9)
at Object.createClient (C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\soap\lib\soap.js:94:5)
at handler (webpack-internal:///(api)/./src/pages/api/identity.js:16:39)
at Object.apiResolver (C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\next\dist\server\api-utils\node.js:367:15)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
page: '/api/identity'
}
`

node.js / node-canvas drawImage properties error

const canvas = pkg.createCanvas(2000, 2000)
const ctx = canvas.getContext("2D")
const image = await pkg.loadImage(url)
console.log(image)
ctx.drawImage(image,0,0)
I try ctx.drawImage, but an error occurred
ctx.drawImage(image,0,0)
^
TypeError: Cannot read properties of undefined (reading 'drawImage')
at loadAndPredict (file:///C:/Users/%EB%B0%95%ED%98%9C%EC%84%B1/source/repos/%EC%A1%B8%EC%97%85%EC%9E%91%ED%92%88/express/js/body-pix.js:18:9)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Properties of drawImage are pkg.Image,number,number and I entered values in pkg.Image,number,number format. However, TypeError occurs

Trying to run a JS script on mac terminal but keep getting NETWORK_ERROR

I am a complete noob and watching a video on ether.js. I am trying to run a script with node.js on my mac terminal but keep getting this error.
MY CODE
const address = '0xb5d85CBf7cB3EE0D56b3bB207D5Fc4B82f43F511';
const main = async () => {
const balance = await provider.getBalance(address);
console.log(`\nETH Balance of ${address} --> ${ethers.utils.formatEther(balance)} ETH\n`)
main()
RUN ERROR
/Users/mac/ethers_examples/node_modules/#ethersproject/logger/lib/index.js:199
var error = new Error(message);
^
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.5.3)
at Logger.makeError (/Users/mac/ethers_examples/node_modules/#ethersproject/logger/lib/index.js:199:21)
at Logger.throwError (/Users/mac/ethers_examples/node_modules/#ethersproject/logger/lib/index.js:208:20)
at JsonRpcProvider.<anonymous> (/Users/mac/ethers_examples/node_modules/#ethersproject/providers/lib/json-rpc-provider.js:517:54)
at step (/Users/mac/ethers_examples/node_modules/#ethersproject/providers/lib/json-rpc-provider.js:48:23)
at Object.throw (/Users/mac/ethers_examples/node_modules/#ethersproject/providers/lib/json-rpc-provider.js:29:53)
at rejected (/Users/mac/ethers_examples/node_modules/#ethersproject/providers/lib/json-rpc-provider.js:21:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
reason: 'could not detect network',
code: 'NETWORK_ERROR',
event: 'noNetwork'
}

node-opcua OPCUAClient.connect error: Invalid position

When connecting to an OPCUA Server using an endpoint (opc.tcp://{serverIP:port}/OPCUASserver), I am getting an error that I do not know how to interpret.
I create an OPCUAClient using:
let client = OPCUAClient.create(clientOptions);
Then call connect
try {
await client.connect(connection.endpoint);
} catch (err) {
console.log('opcuaClient: connection error: ', err);
Here is the log message that gets printed to console:
opcuaClient: connection error: Error: Invalid position : buf.length=0 pos =0
at readTag (/node_js/app/node_modules/node-opcua-crypto/dist/source/asn1.js:36:15)
at Object.split_der (/node_js/app/node_modules/node-opcua-crypto/dist/source/crypto_explore_certificate.js:569:47)
at OPCUAClientImpl.getCertificate (/node_js/app/node_modules/node-opcua-common/dist/opcua_secure_object.js:37:52)
at OPCUAClientImpl.<anonymous> (/node_js/app/node_modules/node-opcua-client/dist/verify.js:106:34)
at Generator.next (<anonymous>)
at /node_js/app/node_modules/node-opcua-client/dist/verify.js:8:71
at new Promise (<anonymous>)
at __awaiter (/node_js/app/node_modules/node-opcua-client/dist/verify.js:4:12)
at OPCUAClientImpl.performCertificateSanityCheck (/node_js/app/node_modules/node-opcua-client/dist/verify.js:104:12)
at OPCUAClientImpl.<anonymous> (/node_js/app/node_modules/node-opcua-client/dist/private/client_base_impl.js:569:62)
at Generator.next (<anonymous>)
at /node_js/app/node_modules/node-opcua-client/dist/private/client_base_impl.js:8:71
at new Promise (<anonymous>)
at __awaiter (/node_js/app/node_modules/node-opcua-client/dist/private/client_base_impl.js:4:12)
at /node_js/app/node_modules/node-opcua-client/dist/private/client_base_impl.js:566:122
at Object.<anonymous> (/node_js/app/node_modules/#ster5/global-mutex/dist/source/index.js:194:26)
I am not sure what this error means.
Thanks!

Resources