question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

puppeteer-core types differ from puppeteer

See original GitHub issue

I’m maintaining the puppeteer add-on ghost-cursor and while upgrading the dependency to puppeteer@7 I noticed some strange differences between puppeteer and puppeteer-core types. For example the Page class is not interchangeable:

 error TS2345: Argument of type 'import("node_modules/puppeteer/lib/types").Page' is not assignable to parameter of type 'import("node_modules/puppeteer-core/lib/types").Page'.
  Types have separate declarations of a private property '_closed'.

Strange enough I can’t find the differences in the generated types.d.ts files:

$ diff node_modules/puppeteer/lib/types.d.ts  node_modules/puppeteer-core/lib/types.d.ts | wc -l
       0

Any idea how this can be fixed? I would prefer to keep using puppeteer-core in the library while users most of the time use the regular puppeteer library.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:14
  • Comments:7

github_iconTop GitHub Comments

2reactions
luna-fire-devcommented, Jul 28, 2022

This is because import('puppeteer').Page and import('puppeteer-core').Page are two different classes defined in two different js files from two different modules (so are the two types in two d.ts files). I am wondering why puppeteer doesn’t import puppeteer-core as a dependency and re-use the classes from puppeteer-core.

1reaction
kldzjcommented, Jul 17, 2022

This is still an issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@types/puppeteer-core - npm
Stub TypeScript definitions entry for puppeteer-core, which provides its own types definitions. Latest version: 7.0.4, last published: a ...
Read more >
Overview of Puppeteer and puppeteer-core in Node.js
"Puppeteer is a Node library that provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless ...
Read more >
Practical Puppeteer: Playing with Puppeteer Core package
The difference between puppeteer and puppeteer-core in the term of launch settings is we have to define the Chrome or Chromium browser ......
Read more >
Playwright vs Puppeteer: Core Differences - BrowserStack
Its API is also available in multiple programming languages like Java, Python, Typescript, JavaScript, and C#. On the other hand, Puppeteer is a ......
Read more >
Puppeteer | Puppeteer
puppeteer-core is a library to help drive anything that supports DevTools protocol. Being a library, puppeteer-core is fully driven through its programmatic ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found