Puppeteer waitForTimeout is not a function - node.js

I am using puppeteer in my latest project. I installed the library using NPM (npm i puppeteer). From the documentation I understood that page.waitFor() function was now deprecated and replaced by page.waitForTimeout().
When I try to use the new function I get UnhandledPromiseRejectionWarning: TypeError: page.waitForTimeout is not a function.
What could be the possible reason? The version of puppeteer I got from NPM is 2.1.1.
Thanks

page.waitForTimeout has been introduced in puppeteer version 5.3.0.
So as was mentioned in the comments, you can't use this new function in version 2.1.1 you had installed.
Bonus: Issue #6214 contains more details to this topic.

Related

How to use version version 14 in facebook-nodejs-business-sdk for Facebook Business API?

This is my first question to Stackoverflow. Please let me know if I need to provide more info.
The facebook-nodejs-business-sdk is still in version 13. Is there a way to call for Facebook Business API version 14?
I tried updating to the latest version from npm installs but its only v13.
The version 14 of the facebook-nodejs-business-sdk module is out now.
To install the latest version of facebook-nodejs-business-sdk you can run in the terminal.
npm install facebook-nodejs-business-sdk#latest
This can be addressed by overriding the SDK API version with the following (right after you require the package):
const bizSdk = require('facebook-nodejs-business-sdk');
// Set ads api version
Object.defineProperty(bizSdk.FacebookAdsApi, 'VERSION', { get: () => 'v14.0' });
Object.defineProperty(bizSdk.FacebookAdsApi, 'SDK_VERSION', { get: () => 'v14.0.0' });```
Hope this helps the many of you in trouble with this.

NodeJS-MSMQ: SyntaxError: Cannot use import statement outside a module

I'm pretty new with NodeJS and I'm trying to use a module called "updated-node-msmq" (from this repository) in my project but getting an error.
What I've done:
I opened a new folder for the project.
I used the command "$ npm install --save updated-node-msmq" and got some warnings (Screenshot attached).
When I try to use the module according to the README, and run my "test.js" file I got the following error here in the screenshot).
I am using version 14.16.0 of NodeJS and after trying to fix this myself I realized that probably the problem is that the module was built for older versions of NodeJS.
I understand that low version is not a recommended solution, but I have no clue how to update a module.
Help / guidance in solving the problem?
Thanks in advance everyone!
Why are you using updated-node-msmq? That package seems like a mess, and the errors you are getting is because the whole module is written with ES2015 but doesn't seem to have been transpiled to node.js compatible code before published to NPM.
I'd advise you to use a tried and tested module for MSMQ first and foremost.
EDIT: Seems like the author fucked up in the 0.2.0 version. You could use the 0.1.9 (by instead using npm install updated-node-msmq#0.1.9 but that one is 3 years old.

error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>

I'm trying to install the node.js project and run
npm install
and got the error
../src/main.cc:137:89: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)'
what is wrong with the project?
the full error is here https://paste.ubuntu.com/p/hJGDfdrKB2/
It looks like the package you are using doesn't support the version of Node you are running. Try running it under Node v8 and see if that corrects the problem. If it does let the package maintainer know it needs updating.
Plasma
downgrading to nodejs-10, worked for me.
Hope this will help.

How to fix 'ERROR ON PAGE: ReferenceError: Can't find variable: require' - NodeJS with Sinon.js

I have problem with test cases running. actually I upgrade node dependency from old version to new version also node version v6 to v10, Before update npm module my code was working fine. But I do not known what issue happen now.
Please help me out that..!

experienced issue with expressjs/nodejs after updating connect

I am currently using the following versions of node & express (ubuntu):
node: 0.6.12
express: 2.5.8
I believe I am using connect v2.0.3.
The error spawns from the http/https.js files inside the express/lib/http.js files (I am referencing http/https in my main app js file):
TypeError: Cannot read property 'prototype' of undefined
express/lib/http.js:50:35
Any thoughts would be welcome on how to resolve the issue - do I need to change the connect version being used or some other solution that can be used to resolve the issue.
Thanks.
Even though the readme file says that it's compatible with node 0.6x, I've generally had plenty of issues with connect and have solved them by installing an older version of it. Try the latest of v1 - npm install connect#1.8.6

Resources