AdvancedCustomFields / acf

Advanced Custom Fields
http://advancedcustomfields.com/
870 stars 180 forks source link

Multiple ACF blocks Failed to load resource: the server responded with a status of 503 #269

Closed amitbiswas06 closed 3 years ago

amitbiswas06 commented 4 years ago

I am here with a heart breaking situation and requires your help. I have been working on my new WP theme for the last 5 months. I am using ACF pro 5.8.7 and developed 18~20 custom guten blocks with it. I have tested and found no issues in my local host which is a wamp server.

But since I moved the site to my staging web server, I am getting admin-ajax.php errors(503) in it. So the page with acf blocks is not loading properly in wp admin. However the front end site is working nicely.

My custom blocks are having moderate fields that requires for them. I am really hopeful that you can help me.

Thanks, Amit Biswas

JiveDig commented 3 years ago

I have a block where a link click opens a tab, or launches a modal, via :target. That css would break my block in the backend. It's a side convo to your actual question, so my apologies there, just confirming that a link is not always a text link that needs disabling.

jonathanrich1986 commented 3 years ago

Hi, just spotted a bug when enabling the ACF_EXPERIMENTAL_PRELOAD_BLOCKS constant. My blocks which have <InnerBlocks />no longer appear in the editor (still works on the front end). Thanks.

Log1x commented 3 years ago

Hi, just spotted a bug when enabling the ACF_EXPERIMENTAL_PRELOAD_BLOCKS constant. My blocks which have <InnerBlocks />no longer appear in the editor (still works on the front end). Thanks.

hmm, I can't reproduce this.

JiveDig commented 3 years ago

Same. InnerBlocks works for me with or without the constant.

elliotcondon commented 3 years ago

@jonathanrich1986 - When possible, can you please put together a basic code example to demonstrate the issue? I'll setup this block in my local environment and see if I can diagnose the problem. It would be great if we could open a new GitHub ticket to work in too 👍.

@JiveDig @Log1x - Thanks for confirming 👍.

pmascis commented 3 years ago

This was another ACF game changer for me, thank you @elliotcondon

GianniSWC commented 3 years ago

Voor de Nederlanders onder ons. Indien je last hebt van trage ACF Blokken in de back-end dan is dit de oplossing.

waynemcmahon commented 3 years ago

@elliotcondon thanks for this. I've added _define('ACF_EXPERIMENTAL_PRELOADBLOCKS', true); to wp-config.php but I am still receiving 504 errors in the backend when there are a lot of block on the page.

image image

GianniSWC commented 3 years ago

@elliotcondon thanks for this. I've added _define('ACF_EXPERIMENTAL_PRELOADBLOCKS', true); to wp-config.php but I am still receiving 504 errors in the backend when there are a lot of block on the page.

image image

What is the amount of memories in WP?

elliotcondon commented 3 years ago

Hi @waynemcmahon Thanks for the report.

Some house-cleaning first: Can you please remove the two duplicate replies above this one?

As for the issue, it looks as if the constant is not having any effect on the page load - hence the spinning wheels displayed in each block and the large number of AJAX calls logged in the browser. Can you please confirm which version of ACF PRO you are using on this website?

waynemcmahon commented 3 years ago

Hi @elliotcondon . Thanks for you response and I've deleted my duplicate post.

I am running version 5.9.5 currently. Adding the constant has had no measurable affect so that I can see

elliotcondon commented 3 years ago

@waynemcmahon Interesting. Would you be available to perform some debugging?

  1. Check file pro/blocks.php and log the $preloaded_blocks value. This should contain all HTML of your blocks during page load. Does it?
  2. In your browser, check the JS data for acf.get('preloadedBlocks'). Does this contain the same data?
  3. Can you spin up a fresh WP install without any other plugins to test if this issue is connected to a plugin compatibility issue?
smerriman commented 3 years ago

Just jumping in to say that the one block that did load in the screenshot was a block in edit mode. If all of his blocks were in edit mode as I suspect, then the constant does nothing.

+1 to the earlier request about supporting preload for blocks in edit mode.

robjimgreen commented 3 years ago

I'm also getting these admin-ajax.php 503 errors – All our custom ACF blocks are locked to edit mode.

Are you able to add the preload support for edit mode please?

robjimgreen commented 3 years ago

@bradt @elliotcondon – I understand ACF was recently acquired by Delicious Brains, are these issues still being actively monitored during the transition?

mattgrshaw commented 3 years ago

@robjimgreen

Yep, we're still monitoring these issues and plan to move the experimental preload blocks functionality into core in the next release. I've made a note to check into supporting edit mode for this release as well 👍

justinkruit commented 3 years ago

Hey @mattgrshaw , that's great news.

Is there any insight you could give about how far this next release is? I always love having new features to play around with, and looking forward to what Delicious Brains is gonna bring to the table

mattgrshaw commented 3 years ago

@justinkruit it's a fairly big release with a lot of things to test, so it's likely a few weeks away at this point. We don't have an exact ETA just yet.

robjimgreen commented 3 years ago

@mattgrshaw I've just been speaking with our hosting provider and apparently having an option to rate-limit the ajax calls could also fix this – I've just tried to use the WordPress Heartbeat Control plugin but I don't think it affects ACF.

mattgrshaw commented 3 years ago

@robjimgreen I think rate-limiting probably isn't ideal here, you'd either see a slowdown with ACF blocks or some of them might not load at all.

It does sound like preloading blocks set to edit mode is the way to go here, and I've raised a PR for that on our private repo for pro. Maybe once that's done our initial review process, you could kick the tires on it as well and see if it fixes the issue for you?

robjimgreen commented 3 years ago

@mattgrshaw No problem at all & thanks for the info – More than happy to test this out :)

mattgrshaw commented 3 years ago

Hey folks, closing this one since block preloading (including blocks in edit mode) has landed in ACF 5.10! Please let us know if you run into any issues with the update.

pmascis commented 3 years ago

@mattgrshaw

Hey there, 5.9 with define('ACF_EXPERIMENTAL_PRELOAD_BLOCKS', true); Worked well for me, but 5.10 now causes errors when duplicating blocks.

Duplicating a block and editing the new blocks content updates the original block and more mixed up functionality between the blocks. Duplicated blocks are have a delayed load when the page is loaded in wp-admin.

This problem has made duplicated/duplicating blocks unusable. Furthermore this error means, I can't update ACF on any of my sites using Gutenberg.

Has anyone else encountered similar?

I made a support ticket on the ACF site, but I thought I'd mention here anyway. Let me know if you need more information.

mattgrshaw commented 3 years ago

@pmascis Yep, we're aware of this bug and found a fix, this will be rolled out in 5.10.2 this coming week.

SergiArias commented 2 years ago

I still have this problem with 5.12.2... Was it really solved?

lgladdy commented 2 years ago

I still have this problem with 5.12.2... Was it really solved?

We shipped block preloading, but due to a breaking change made by the Gutenberg team in WordPress 5.9, had to disable edit mode block preloading again in ACF 5.12 until we can restructure the way edit mode preloading works. We're hoping to re-enable this in our next release.

mike-sheppard commented 2 years ago

hey, @lgladdy hate to chase as I know you guys are super busy + appreciate all the hard work going into all the ACF updates. But do you have an ETA on preloading being re-enabled? One of our partner's sites is grinding to a halt while editing

lgladdy commented 2 years ago

@mike-sheppard Preloading should only be disabled for blocks saved in edit mode, but if you've got loads of blocks like that then I understand this is frustrating!

We're targeting re-enabling of this for our next release, but that's likely a couple of months away. We'll try and get this out in a beta in the coming weeks though.

WordPress changed the scope in which internal REST preloads take place in WordPress 5.9, this means any assets that get enqueued are deemed satisfied by the REST preload, but then aren't enqueued for the actual page - meaning a bunch of ACF's JavaScripts aren't loaded correctly in the block editor - we're trying to overcome that issue by detecting when an internal REST preload happens, but WordPress don't offer any way to determine that automatically, so it's a significant challenge for us to overcome - that's why we weren't able to roll out a quick fix in one of the minor releases for ACF 5.12

luicephillips commented 2 years ago

I have tried with all above solutions, but still the issue is not resolved, can anybody please help me

michelmany commented 2 years ago

@lgladdy, thanks for your detailed reply. JFYI, I am still getting this error with v. ACF PRO 5.12.2. It works fine locally but not in the client's hosting. Thank you.

lgladdy commented 2 years ago

@michelmany Our current preview build (#654) will resolve this issue, but it's currently in alpha so not recommended for production sites - but it will be in the next release!

Rickyc81 commented 2 years ago

Thanks.. I've same issue in loading of multiple block in edit mode.. :( I switch it in preview mode for remedy the problem momentarily.. when is the release scheduled?

Thanks!!

davidwebca commented 2 years ago

@lgladdy Sorry for the ping. Is the preview build you're talking about 6.0.0-RC3 or merged with it?

Rai-burger commented 6 months ago

6.2.9 here and experiencing the same issue ☹ if I go to "code editor" and then go back to "visual editor" it makes new requests and loads the missing blocks image image

lgladdy commented 6 months ago

@Rai-burger It would seem block preloading isn't working for you here, unless you've changed every block in the code editor (in which case, you'd expect this to happen)

We're getting close to releasing ACF 6.3.0-beta1, I'll leave in a bunch of preload debugging in that so you can see what's going on. We may have fixed the preloading bug in that anyway (it seems WP 6.5 changed the way some blocks are initialised, meaning you could miss the preload on the second load)