Skip to content
New issue

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

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

Already on GitHub? # to your account

Update puppeteer types to accept puppeteer-core from outside Lighthouse #16152

Open
yasserhussien opened this issue Aug 14, 2024 · 3 comments
Open
Assignees

Comments

@yasserhussien
Copy link

When I try to use Cypress/puppeteer plugin for lighthouse user flow it doesn't work for me
The problem is that the function startFlow from lighthouse assume that he will receive the page from lighthouse/types/puppeteer but it received from puppeteer-core/lib/types.
is there a way to solve this problem OR should we use puppeteer itself and there is no way to work with cypress?

@yasserhussien yasserhussien changed the title Cypress/puppeteer plugin isn't supported for lighthouse user Flow lighthouse user Flow isn't work with Cypress/puppeteer plugin Aug 14, 2024
@adamraine
Copy link
Member

adamraine commented Aug 16, 2024

Lighthouse type checking will accept a page from the puppeteer package in your dependencies but not necessarily the puppeteer-core so that is likely the root of the issue. Is it just a type error, or are there any runtime errors?

@yasserhussien
Copy link
Author

yasserhussien commented Aug 17, 2024

Hi @adamraine
yes it is a type error

@yasserhussien yasserhussien changed the title lighthouse user Flow isn't work with Cypress/puppeteer plugin lighthouse user Flow doesn't work with Cypress/puppeteer plugin Aug 19, 2024
@adamraine
Copy link
Member

It might be possible, but would possibly be a breaking change. Right now Lighthouse accepts puppeteer page's from two locations:

  1. The puppeteer-core package in LIghthouse's package dependencies
  2. The first puppeteer package we find in node_modules

We would need to expand this list:

  1. The puppeteer-core package in LIghthouse's package dependencies
  2. The first puppeteer package we find in node_modules
  3. The first puppeteer-core package we find node_modules

1 & 3 overlap so I think we might need to give an alias to the package in Lighthouse's deps? I think for now it's easiest to just @ts-expect-error this one but we can track the upgrade here.

@adamraine adamraine assigned adamraine and unassigned paulirish Aug 20, 2024
@adamraine adamraine changed the title lighthouse user Flow doesn't work with Cypress/puppeteer plugin Update puppeteer types to accept puppeteer-core from outside Lighthouse Aug 20, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants