magesuite / magepack

Next generation Magento 2 advanced JavaScript bundler.
Open Software License 3.0
437 stars 91 forks source link

Evaluation failed: TypeError: require is not a function at __puppeteer_evaluation_script__:3:17 #82

Open bellodaniel opened 3 years ago

bellodaniel commented 3 years ago

Hello.

I am trying to install the Magepack bundle module on AWS, Centos7 environment. However, when trying to run the command to generate the bundle files, it doesn't work. On production mode, it stuck: https://shero.d.pr/VsOtxc. On developer mode, it throws this error: https://shero.d.pr/hLMd8i

[ec2-user@ip-172-31-2-235 current]$ magepack generate --auth-username="shero" --auth-password="shero123" --cms-url="https://qa.painfulpleasures.com" --category-url="https://qa.painfulpleasures.com/body-jewelry/basic-piercing-jewelry/bent-barbells.html" --product-url="https://qa.painfulpleasures.com/18g-internal-0-8mm-titanium-bent-barbell-price-per-1.html" --debug
ℹ Collecting bundle modules in the browser.                                                                                                                                                                                                                                                                                  13:22:21
ℹ Collecting modules for bundle "category".                                                                                                                                                                                                                                                                                  13:22:21
› Authenticating with given user and password.                                                                                                                                                                                                                                                                               13:22:21

 ERROR  Evaluation failed: TypeError: require is not a function                                                                                                                                                                                                                                                              13:22:26
    at __puppeteer_evaluation_script__:3:17
    at new Promise (<anonymous>)
    at __puppeteer_evaluation_script__:2:13

  at __puppeteer_evaluation_script__:3:17
  at new Promise (<anonymous>)
  at __puppeteer_evaluation_script__:2:13
  at ExecutionContext._evaluateInternal (/usr/lib/node_modules/magepack/node_modules/puppeteer/lib/ExecutionContext.js:122:13)
  at processTicksAndRejections (internal/process/task_queues.js:93:5)
  at async ExecutionContext.evaluate (/usr/lib/node_modules/magepack/node_modules/puppeteer/lib/ExecutionContext.js:48:12)
  at async module.exports (/usr/lib/node_modules/magepack/lib/generate/collectModules.js:19:5)
  at async Object.category (/usr/lib/node_modules/magepack/lib/generate/collector/category.js:40:33)
  at async module.exports (/usr/lib/node_modules/magepack/lib/generate.js:24:13)
  -- ASYNC --
  at ExecutionContext.<anonymous> (/usr/lib/node_modules/magepack/node_modules/puppeteer/lib/helper.js:111:15)
  at DOMWorld.evaluate (/usr/lib/node_modules/magepack/node_modules/puppeteer/lib/DOMWorld.js:112:20)
  at processTicksAndRejections (internal/process/task_queues.js:93:5)
  -- ASYNC --
  at Frame.<anonymous> (/usr/lib/node_modules/magepack/node_modules/puppeteer/lib/helper.js:111:15)
  at Page.evaluate (/usr/lib/node_modules/magepack/node_modules/puppeteer/lib/Page.js:860:43)
  at Page.<anonymous> (/usr/lib/node_modules/magepack/node_modules/puppeteer/lib/helper.js:112:23)
  at module.exports (/usr/lib/node_modules/magepack/lib/generate/collectModules.js:19:16)
  at processTicksAndRejections (internal/process/task_queues.js:93:5)
  at async Object.category (/usr/lib/node_modules/magepack/lib/generate/collector/category.js:40:33)
  at async module.exports (/usr/lib/node_modules/magepack/lib/generate.js:24:13)

These are my setups:

What steps will reproduce the problem?

  1. Install magepack and puppeteer.
  2. Try to run the magepack generate command
JackWormUK commented 3 years ago

You have alot of JAVA errors on your category page. Magepack doesn't deal with java errors very well when it is crawling.

Edit. I have just set Magepack up on Centos to bundle a store that has no Java errors and it worked in the bundling process (but generated Java errors when the bundling was applied)

krzksz commented 3 years ago

Hey, as mentioned above please make sure that the pages you're telling Magepack to analyze are working properly and have not JavaScript errors/404 and everything should work just fine.