I'm getting a syntax error while in the function node code editor (red underline squiggles and triangle):
const puppeteer = global.get('puppeteer');
(async () =>
{
const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium'});
const page = await browser.newPage();
await page.goto('http://church.daford.work:58080', { waitUntil: 'networkidle0'});
await page.type('#password', 'pwd-here');
await page.click('#loginBtn');
// @ts-ignore
const data = await page.evaluate(() => document.querySelector('*').outerHTML);
console.log(data);
await browser.close();
})();
Cannot find name 'document'. Do you need to change your target library?
Try changing the 'lib' compiler option to include 'dom'.(2584)
Where do I do this?
UPDATE: I found I can ignore this error with
// @ts-ignore
and the code works, but I would like to know if there is a better way to handle this.