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

Puppeteer firefox promise sometimes returns array, sometimes object #4295

Closed
jan0991 opened this issue Apr 17, 2019 · 4 comments
Closed

Puppeteer firefox promise sometimes returns array, sometimes object #4295

jan0991 opened this issue Apr 17, 2019 · 4 comments

Comments

@jan0991
Copy link

jan0991 commented Apr 17, 2019

My code that I execute inside browser:

const getArticles = async (page) => {
    return await page.evaluate(() => {
        ...
        return Promise.resolve(formated.filter(x => x)) // formated is a normal array
    });
}

I have to call it like this:

        let newArticles = await getArticles(page)
         if(!Array.isArray(newArticles)) {
            newArticles = newArticles._v
        }

It seems very random. Sometimes it returns an array, sometimes object. With chrome, it was array every single time. Any ideas?

@jan0991 jan0991 closed this as completed Apr 19, 2019
@aslushnikov
Copy link
Contributor

@jan0991 did it resolve itself?

@jan0991
Copy link
Author

jan0991 commented Apr 22, 2019

I thought so, but nope. Still does this randomly.

@jan0991 jan0991 reopened this Apr 22, 2019
@aslushnikov
Copy link
Contributor

@jan0991 so can you please share a small script that will reproduce this?

@mjzffr
Copy link
Contributor

mjzffr commented Jan 13, 2020

Thanks for the report. I'm closing this issue since the experimental puppeteer-firefox package is no longer maintained. A replacement will be available
later this year. You can learn more about Mozilla's work on this at https://wiki.mozilla.org/Remote

See also #5137

@mjzffr mjzffr closed this as completed Jan 13, 2020
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

3 participants