[Bug] TypeScript issues with puppeteer v7 ("no exported member" error, etc)
See original GitHub issueDescribe the bug Minimum Reproducible Code
- unzip this file
- run
npm install
- run
tsc
Expected: typescript compiles Actual: lots of “namespace has no exported member” errors
This is just from importing the library. When I have actual puppeteer code i get many more errors for lots of other un-exported modules.
node_modules/puppeteer-extra-plugin/dist/index.d.ts:315:39 - error TS2694: Namespace '"/puppeteer-extra-bug/node_modules/puppeteer/lib/types"' has no exported member 'Worker'.
315 onWorkerCreated(worker: Puppeteer.Worker): Promise<void>;
~~~~~~
node_modules/puppeteer-extra/dist/puppeteer.d.ts:6:10 - error TS2305: Module '"../../puppeteer/lib/types"' has no exported member 'FetcherOptions'.
6 export { FetcherOptions } from 'puppeteer';
~~~~~~~~~~~~~~
[10:54:40 AM] Found 2 errors. Watching for file changes.
Code Snippet
import puppeteer from "puppeteer-extra";
import StealthPlugin from "puppeteer-extra-plugin-stealth";
puppeteer.use(StealthPlugin());
Versions
System:
OS: macOS 10.15.5
CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
Memory: 139.73 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.23.1 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.10 - /usr/local/bin/npm
npmPackages:
puppeteer: ^7.1.0 => 7.1.0
puppeteer-extra: ^3.1.16 => 3.1.16
puppeteer-extra-plugin-stealth: ^2.7.4 => 2.7.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Puppeteer types node_modules/puppeteer/lib/types"' has ...
Show activity on this post. I have got a problem with puppeteer types, I'm trying to import Cookie type, but it doesn't work...
Read more >Changelog | Wechaty - JS.ORG
Using wechaty to start a wechatOA account #1016. Fixed bugs: FileBox instance type checking problem #2035; Wechaty.off() not work: can not remove listeners....
Read more >mozilla-release: changeset 643121 ... - Mercurial
This problem was fixed in Node 10.19, but we run the unit tests ... closes [#6761](https://github.com/puppeteer/puppeteer/issues/6761) + + +### Bug Fixes + ...
Read more >Gatsby Changelog | 5.3.0
In the PR feat(gatsby-worker): Show original stack trace we have now given gatsby-worker the ability to save its errors to a local, temporary...
Read more >webdriverio/webdriverio - Gitter
Hello, I have a strange problem with setValue() for a field in Chrome ... src/javaObject.cpp:117:18: error: no member named 'SetHiddenValue' in 'v8::Object'
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah it’s a real tragedy. Of 100 types the
@types/puppeteer
package originally exported, 51 are no longer available with an additional 23 that no longer match the original types for various reasons. And that’s just the top level type exports.To burn through 3 major versions in a matter of a month is not something you see everyday…
@davidbielik puppeteer has broken typings in recent versions, just look at this mess: https://github.com/puppeteer/puppeteer/releases
Solution: Use
puppeteer@5
for now.Longer answer: It’s painful to see that puppeteer broke perfectly fine typings through
@types/puppeteer
. Due to them shipping their own (somewhat broken) builtin types the dedicated typing package won’t be used anymore if present. I’m monitoring the situation but it’s really up to the puppeteer project to fix this typing mess.Even without using -extra you will see TypeScript issues with puppeteer@7