ghost-cursor Error : elem.remoteObject is not a function in puppeteer

Viewed 17

whenever I run the script in the Local system the cursor properly worked and when I run inside docker that time I fetch an Error so anybody guid me what is wrong or whether this issue is package side or not.?

when I run in Locally that time I headless: false and Run inside docker that time headless: true but I tried inside docker headless: false but it can't work

here is code

const puppeteer = require('puppeteer');
const {path,createCursor} = require("ghost-cursor");
const url = process.argv[2];

async function run() {
    browser = await puppeteer.launch({
        args: ['--disable-gpu', '--no-first-run', '--no-sandbox', '--no-zygote'],
        "dumpio": true,
        "devtools": false,
        "ignoreHTTPSErrors": true,
    });

    const page = await browser.newPage();
    const cursor = createCursor(page);
    await cursor.move(selector)
    await page.goto(url);
    await page.screenshot({ path: 'screenshot.png' });
    browser.close();
}
run();

Here is Error Message 

    TypeError: elem.remoteObject is not a function
    at Object.<anonymous> (/usr/app/node_modules/ghost-cursor/lib/spoof.js:458:61)
    at step (/usr/app/node_modules/ghost-cursor/lib/spoof.js:44:23)
    at Object.next (/usr/app/node_modules/ghost-cursor/lib/spoof.js:25:53)
    at fulfilled (/usr/app/node_modules/ghost-cursor/lib/spoof.js:16:58)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
0 Answers
Related