Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on setViewport #8

Open
micheldpcarlos opened this issue Mar 25, 2019 · 0 comments
Open

Error on setViewport #8

micheldpcarlos opened this issue Mar 25, 2019 · 0 comments

Comments

@micheldpcarlos
Copy link

micheldpcarlos commented Mar 25, 2019

TypeError: Cannot read property 'execScript' of undefined

On resize the viewport, the following error occurs:

{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.
(function(width, height) {
    var onResize = new Promise(function(resolve) {
        return self.addEventListener('resize', function() {
            return resolve();
        });
    });
    self.resizeTo(
        self.outerWidth - self.innerWidth + width,
        self.outerHeight - self.innerHeight + height
    );
    return onResize;
})
TypeError: Cannot read property 'execScript' of undefined
    at ExecutionContext.evaluate (C:\Projects\node_modules\puppeteer-ie\source\ExecutionContext.js:151:31)
    at Page.evaluate (C:\Projects\node_modules\puppeteer-ie\source\Page.js:375:31)
    at Page.setViewport (C:\Projects\node_modules\puppeteer-ie\source\Page.js:502:21)
    at C:\Projects\login.js:13:8
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
    at Function.Module.runMain (module.js:696:11)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3

Here the code that reproduces the error:

const puppeteer = require('puppeteer-ie')
const screenshot = 'test.png';
(async () => {
  const browser = await puppeteer.launch({ headless: true });
  const page = await browser.newPage();
  await page.setViewport({
    width: 1080,
    height: 1920
  });
  await page.goto('http://gmail.com')
  await page.screenshot({ path: screenshot });
  browser.close();
  console.log('See screenshot: ' + screenshot);
})()

Node: v8.15.1
puppeteer-ie: v0.5.7
OS: Windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant