Skip to content

waitForNavigation doesn't return after page.goto #12

@v4dkou

Description

@v4dkou

I've tried using the library, but nothing seemed to work after i call page.goto.
Digging in, I've copied the internal implementation of it to my code to debug and found out that .waitForNavigation doesn't return, because the filter never returns true.
Apparently __value fields are replaced with a circular dependency on the Page object, and I am not quite sure how it happens.

const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();

console.log(page._target.__value)
page._target.Navigate( "https://example.com" )
try {
    await waitFor(
        1000,
        ()  =>  {
            return page._target.Busy  &&  (page._target.Busy == false)
        }
    );
    console.log('ended the wait')
} catch (e) {
    console.log('crashed')
    console.log(page._target.__value)
}

Running the code yields

W:\iecontroller>node test.js
Internet Explorer
crashed
<ref *1> [Function: undefined] Dispatch {
  [__vars]: {},
  [__methods]: {},
  [__type]: [],
  [__value]: [Circular *1],
  [__id]: 'InternetExplorer.Application'
}
TypeError: this._target.Quit is not a function
    at Page.close (W:\iecontroller\node_modules\puppeteer-ie\source\Page.js:153:26)
    at W:\iecontroller\node_modules\puppeteer-ie\source\Browser.js:43:77
    at Array.map (<anonymous>)
    at Browser.close (W:\iecontroller\node_modules\puppeteer-ie\source\Browser.js:43:46)
    at W:\iecontroller\node_modules\puppeteer-ie\source\index.js:72:53
    at Array.map (<anonymous>)
    at process.clear (W:\iecontroller\node_modules\puppeteer-ie\source\index.js:72:30)
    at process.emit (events.js:315:20)

Versions:
node: v14.15.1
npm: 6.14.8
OS: Windows 10 (v1909, build 18363.1198)

Also tried setting the node version to exactly 7.6.0 and specifying the winax version to 1.0.16, but no luck there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions