GithubHelp home page GithubHelp logo

Comments (25)

lockHrt avatar lockHrt commented on May 18, 2024 2

I got it working with the pkg. I included the whole stealth module in the package.json file:

"pkg": {
    "scripts": ["node_modules/puppeteer/lib/*.js", "node_modules/puppeteer-extra-plugin-stealth/**/*.js"]
  }

While compiling with pkg you will get bunch of warnings that 'ava' module not found. You can ignore them. That module is used in an example .js file which is included with the plugin. You won't be needing that.

from puppeteer-extra.

AsianPotato avatar AsianPotato commented on May 18, 2024 1

Thanks a lot for the quick reply!

from puppeteer-extra.

berstend avatar berstend commented on May 18, 2024 1

@AsianPotato I just published [email protected] with a fix, everything should work now.

Rerunning yarn add puppeteer-extra-plugin-stealth in your project should be enough to fetch the new version.

Apologies for that bug, I rewrote parts in typescript just yesterday and for some mysterious reasons the CI tests didn't complain about this issue. 😄

from puppeteer-extra.

berstend avatar berstend commented on May 18, 2024 1

Keep in mind that the example script you're using is making use of two plugins that need to be installed.

So next to yarn add puppeteer puppeteer-extra you also need to run yarn add puppeteer-extra-plugin-stealth puppeteer-extra-plugin-anonymize-ua for the example script to work.

Maybe I should make that clearer in the readme.

from puppeteer-extra.

Dam998 avatar Dam998 commented on May 18, 2024 1

@eduardoewgo I fixed it using nexe instead of pkg

from puppeteer-extra.

eduardoewgo avatar eduardoewgo commented on May 18, 2024 1

@gantonioid

In the output dir, simply run npm install for both packages - it will create the node_modules within all dependencies of this package. This is ugly and defeats the purpose of having a .exec, but it's my only working version atm.

from puppeteer-extra.

gantonioid avatar gantonioid commented on May 18, 2024 1

After giving up, a new requirement brought me again to this issue and I finally got it to work using @lockHrt 's suggestion THANKS A LOT... in my case I added node_modules/puppeteer-extra-plugin-stealth/**/*.js to the scripts array (I already had the other one)

I got it working with the pkg. I included the whole stealth module in the package.json file:

"pkg": {
    "scripts": ["node_modules/puppeteer/lib/*.js", "node_modules/puppeteer-extra-plugin-stealth/**/*.js"]
  }

While compiling with pkg you will get bunch of warnings that 'ava' module not found. You can ignore them. That module is used in an example .js file which is included with the plugin. You won't be needing that.

from puppeteer-extra.

berstend avatar berstend commented on May 18, 2024

Whoops, I have an idea why that might be - I rewrote the base plugin in typescript and changed the exports to be named. Let me check!

from puppeteer-extra.

berstend avatar berstend commented on May 18, 2024

@AsianPotato could you run yarn list puppeteer-extra-* real quick and paste the output here? thanks!

from puppeteer-extra.

berstend avatar berstend commented on May 18, 2024

Nevermind I found the issue - fixing it now 😄

from puppeteer-extra.

berstend avatar berstend commented on May 18, 2024

@AsianPotato thanks a lot for the issue, I've improved the main example to be much clearer for the next person. :-)

from puppeteer-extra.

Dam998 avatar Dam998 commented on May 18, 2024

Hi
I have this problem with puppeteer-extra-plugin-stealth version 2.4.9
If I execute my software in cli with npm start, all work fine but if I create an exe with pkg I will receive this error:

      A plugin listed 'puppeteer-extra-plugin-stealth/evasions/chrome.runtime' as dependency,
      which is currently missing. Please install it:

      yarn add puppeteer-extra-plugin-stealth

      Note: You don't need to require the plugin yourself,
      unless you want to modify it's default settings.

How can I fix this?

thank you @berstend

from puppeteer-extra.

eduardoewgo avatar eduardoewgo commented on May 18, 2024

Getting the same issue as @Dam998...

"puppeteer": "^8.0.0",
"puppeteer-extra": "^3.1.16",
"puppeteer-extra-plugin-stealth": "^2.7.5"

from puppeteer-extra.

berstend avatar berstend commented on May 18, 2024

@eduardoewgo could you check with the latest versions?

(at the time of writing):

from puppeteer-extra.

eduardoewgo avatar eduardoewgo commented on May 18, 2024

@Dam998 kinda hard to move away from pkg at this point and I've tried nexe in the past; just can't remember what was the issue back then.. anyway, I'll try a bit more on this and last resource nexe.

@berstend I've installed the newest version and the error persists 😞

Just to give some context

This is the module loading up puppeteer.

const chromeExecutablePath = path.join(execPath, 'chromium/win64-856583/chrome-win/chrome.exe')
const puppeteer = require(`puppeteer-extra`)
const StealthPlugin = require(`puppeteer-extra-plugin-stealth`)

puppeteer.use(StealthPlugin())

This is the message I got

 A plugin listed 'puppeteer-extra-plugin-stealth/evasions/chrome.app' as dependency,
          which is currently missing. Please install it:

          yarn add puppeteer-extra-plugin-stealth

Any other suggestion, @berstend ?

from puppeteer-extra.

berstend avatar berstend commented on May 18, 2024

@eduardoewgo well, the issue is that their bundler trips over the dynamic imports: vercel/pkg#343

so what you might want to try is hardcoding the evasion imports somewhere in your code like this (to make the bundler aware of them):

require('puppeteer-extra-plugin-stealth/evasions/chrome.app')
// ...

from puppeteer-extra.

berstend avatar berstend commented on May 18, 2024

There's also stuff like this you might want to look into:

"pkg": {
    "scripts": "node_modules/puppeteer/lib/*.js"
  }

(using that for the stealth evasions)

from puppeteer-extra.

eduardoewgo avatar eduardoewgo commented on May 18, 2024

@berstend only solution was to manually install both puppeteer-extra-plugin-stealth and puppeteer-extra to the output dir 😞

It's the only packag that is not being properly compiled by pkg/nexe. Well, not sure how viable this is gonna be once this is finished, but it's the only way I could get a working .exe now.

from puppeteer-extra.

eduardoewgo avatar eduardoewgo commented on May 18, 2024

btw, I am using typescript - shouldn't matter, but just in case.

from puppeteer-extra.

gantonioid avatar gantonioid commented on May 18, 2024

@eduardoewgo what do you mean by

@berstend only solution was to manually install both puppeteer-extra-plugin-stealth and puppeteer-extra to the output dir 😞

from puppeteer-extra.

taytanqbpass avatar taytanqbpass commented on May 18, 2024

@eduardoewgo I fixed it using nexe instead of pkg
i
Hi, im also encountering this issue in pkg, how do I workaround using nexe? thanks.

from puppeteer-extra.

Dam998 avatar Dam998 commented on May 18, 2024

@eduardoewgo I fixed it using nexe instead of pkg
i
Hi, im also encountering this issue in pkg, how do I workaround using nexe? thanks.

Wdym?
just go to github page of nexe and follow their istruction to build an exe file : 3

from puppeteer-extra.

rabbit-yashow avatar rabbit-yashow commented on May 18, 2024

Did anybody get it working?

from puppeteer-extra.

TheJizel avatar TheJizel commented on May 18, 2024

@rabbit-yashow I updated my global pkg to the latest version (5.4.1) and am no longer having this issue.

from puppeteer-extra.

yadegenn avatar yadegenn commented on May 18, 2024

in which package package.json you write this json so that it would work?

from puppeteer-extra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.