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.

[Bug] TypeScript issues with puppeteer v7 ("no exported member" error, etc)

See original GitHub issue

Describe the bug Minimum Reproducible Code

  1. unzip this file
  2. run npm install
  3. 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:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
1nVitr0commented, Mar 13, 2021

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…

7reactions
berstendcommented, Feb 18, 2021

@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

Read more comments on GitHub >

github_iconTop 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 >

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