Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magepack never ends process with no error #37

Closed
Krapulat opened this issue Jul 6, 2020 · 10 comments · Fixed by #151
Closed

Magepack never ends process with no error #37

Krapulat opened this issue Jul 6, 2020 · 10 comments · Fixed by #151

Comments

@Krapulat
Copy link

Krapulat commented Jul 6, 2020

I'm trying to generate the bundler configuration but I can't. First, it gave me timeout errors. So I increased the timeout. But now it never ends the process with no error (with --debug). The website also works perfectly with no JS error in the console. The only output is:

ℹ Collecting bundle modules in the browser.                                                                                                                                
ℹ Collecting modules for bundle "category"

What can I do to debug more?

@jellesiderius
Copy link

jellesiderius commented Jul 7, 2020

Running into the same issue here. Is seems like collectModules.js can't continue on line 20.

await page.evaluate(
      () =>
          new Promise((resolve) => {
              require(['rjsResolver'], (resolver) => {
                  resolver(() => resolve());
              });
          })
  );

@mdkdev
Copy link

mdkdev commented Jul 9, 2020

Same here. Can't seem to figure out what's going wrong. Anyone?

@mdkdev
Copy link

mdkdev commented Jul 9, 2020

It's not a solution, but in my case this only happens in production mode. Switching to developer mode solved the problem for now.

@IvanChepurnyi
Copy link
Contributor

Run into similar issues before, solution is to run it with --debug mode and when it shows you chromium window you can open console and check JS error.s. Usually for me it was a result of some third-party script loading forever or JS file having error in console.

@jellesiderius
Copy link

jellesiderius commented Jul 21, 2020

When opening with --debug i can't seem to find any weird scripts being loaded or anything being stuck...

After commenting out the 'rjsResolver' bit and adding a wait(10000), it starts collecting everything. This is no solution of course, but something in the process does not seem to be working correct.

@Quazz
Copy link

Quazz commented Sep 2, 2020

For me this happened when minify JS was enabled. Works fine when it is disabled.

@dvrgoc
Copy link

dvrgoc commented Sep 9, 2020

It would be great if verbose mode levels are passed as parameters and see where it gets stuck. For some unknown reason, cannot generate config file in a project I am working (there are no JS issues on the URLs used in generate command in DevTools), yesterday it was working OK.

@birdman002
Copy link

birdman002 commented Jan 19, 2021

We as well are having the same issues its getting caught on third party call to google for the recaptcha. Stays on pending forever. Sometimes it comes through no problem other times it gets hung up and doesnt work. During normal testing (not in chromium browser and not trying to bundle) recaptcha loads just fine and takes less than 100ms to load.

@mattc321
Copy link

mattc321 commented Jan 29, 2021

Any script error can cause the process to hang which is a separate issue with how errors are caught/handled.

The specific error OP mentioned will result in "TypeError: require is not a function" which can happen when you go to generate again after previously bundling. Turn bundling off in magento config and flip back to developer mode to generate.

Another common error I saw was page timeouts while generating. These will also result in the script hanging indefinitely and can occur randomly on category, cms, product, or checkout. The default page timeout is 30 seconds, which isn't quite generous enough for some machines to generate locally. This fix requires a code change. Our fork with it.

@laurnts
Copy link

laurnts commented Apr 19, 2021

This issue with "infinite loading" mostly happens when the page it's self is already loading Magepack bundle-common and Magepack bundle(categories / checkout / etc)... So when you're re-running Magepack (to generate new magepack.config.js) You need to prevent the existing magepack bundle js loading in the Dom.

php bin/magento config:set dev/js/enable_magepack_js_bundling 0
php bin/magento cache:flush

After you make sure that the page load without the bundle, only then you can run the magepack generate and magepack bundle. Once it's finished, re-activate Magepack by running the command below

php bin/magento config:set dev/js/enable_magepack_js_bundling 1
php bin/magento cache:flush

Include this deactivation -> magepack -> reactivation sequence in your deployment sequence and that should be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants