Trying to run the following code:
const launchChrome = require('@serverless-chrome/lambda');
export const hello = (event, context, callback) => {
launchChrome({}).then(chrome => {
console.log(chrome);
callback(null, {
status: 'it worked'
})
}).catch(callback);
};
via serverless invoke local -f first I receive the error: launchChrome is not a function. Is the readme out of date with the API?
Hi @zachschultz — Hm.. What do you get when you console.log(launchChrome) ? Does the following work?
const launchChrome = require('@serverless-chrome/lambda').default;
export const hello = (event, context, callback) => {
launchChrome().then(chrome => {
console.log(chrome);
callback(null, {
status: 'it worked'
})
}).catch(callback);
};
@adieuadieu Following code works.