puppeteer-extra icon indicating copy to clipboard operation
puppeteer-extra copied to clipboard

[Bug] Unable to compile most recent version of Puppeteer Stealth - (Error: Cannot find module 'puppeteer-extra-plugin-stealth/evasions/chrome.app')

Open dracoDevs opened this issue 4 years ago • 1 comments

I have a web-app that utilizes Puppeteer Stealth but on runtime after using the pkg to compile my app to a standalone executable, I am greeted with the following error:

Error: Cannot find module 'puppeteer-extra-plugin-stealth/evasions/chrome.app'
Require stack:
- C:\snapshot\Draco\Desktop\Programs\Github Projects\node_modules\puppeteer-extra\dist\index.cjs.js
- C:\snapshot\Draco\Desktop\Programs\Github Projects\Testing\browser.js
- C:\snapshot\Draco\Desktop\Programs\Github Projects\Testing\index.js
1) If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
    at Function._resolveFilename (pkg/prelude/bootstrap.js:1709:46)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at Module.require (pkg/prelude/bootstrap.js:1591:31)
    at require (internal/modules/cjs/helpers.js:88:18)
    at PuppeteerExtra.resolvePluginDependencies (C:\snapshot\Draco\Desktop\Programs\Github Projects\node_modules\puppeteer-extra\dist\index.cjs.js:300:23)
    at PuppeteerExtra.launch (C:\snapshot\Draco\Desktop\Programs\Github Projects\node_modules\puppeteer-extra\dist\index.cjs.js:118:14)
    at NikeGen.genAccounts (C:\snapshot\Draco\Desktop\Programs\Github Projects\Testing\browser.js)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\snapshot\\Draco\\Desktop\\Programs\\Github Projects\\node_modules\\puppeteer-extra\\dist\\index.cjs.js',
    'C:\\snapshot\\Draco\\Desktop\\Programs\\Github Projects\\Testing\\browser.js',
    'C:\\snapshot\\Draco\\Desktop\\Programs\\Github Projects\\Testing\\index.js'
  ],
  pkg: true
}

I have tried using nexe to compile my app but nexe does not support x64 at the moment.

dracoDevs avatar Jun 26 '21 15:06 dracoDevs

have you tried https://github.com/vercel/pkg/issues/910 ?

krthush avatar Aug 14 '21 05:08 krthush

This solution worked for me: https://github.com/vercel/pkg/issues/910#issuecomment-1374872029

aditodkar avatar Jan 08 '23 16:01 aditodkar