Admin dashboard works, but site homepage won't load (v2.2.3)

I thought I’d give Local by Flywheel another go since it seems to have come a long way since v1.0. Setup was easy, and I was able to pull from our live site without any issues.

However, when I try to access the local site, the homepage won’t actually load. I can see it fetches the page title from the document, because my browser tab shows the title, but no text or images ever load. This happens in Safari and Chrome on macOS. Strangely enough, the admin part of the site works perfectly. I can login to the site admin section locally, and poke around, but I can’t actually view any non-admin pages. Obviously, that’s a non-starter for development.

Please advise. Screenshots attached.

Hi @jongrall,

Sorry for the trouble!

Is there anything visible if you view the page source?

Also, one thing you can try is enabling WP_DEBUG in the wp-config.php file in the site’s app/public folder.

Hi @clay,

Thanks for the quick reply. Now that I check the page source, it seems to all be there. I see what looks like a minified version of the normal HTML document. I guess my browser isn’t rendering anything because it’s waiting for the document to finish loading, which never occurs. I imagine I can change that setting in the browser to at least render some stuff, but it still doesn’t help fix the problem that the load never completes. Without the document loading fully, jQuery functions and so forth won’t run either, since they’re waiting for the load to finish.

I enabled WP_DEBUG in the wp-config.php file as you suggested, and restarted the site, but the problem remains and I didn’t get any useful error message from PHP. Upon restart, I briefly noticed the following error (see screenshot), but it then disappeared for subsequent requests (perhaps it was just the first request hitting an error because the server wasn’t ready yet?).

Hi Jon, you’re not alone. THIS is exactly what has been happening to my site since yesterday. I posted earlier with no response. Thanks for putting it out there again.

1 Like

@jongrall out of curiosity was this a new install or did you import the site in any way?

If it was a fresh setup, do you know if was loading at any point before it started revealing a white screen?

May be worth trying a full new site just to see what’s happening. I’m testing a few things on my end as well to see if I can’t get this quirky one to show on my end.

@t-rave I had Local by Flywheel installed a few months ago (an earlier version), and gave up and uninstalled it at the time because it seemed only semi-functional and I didn’t feel like wrestling with it. I uninstalled it using AppZapper, but it’s possible some .plist file was left behind or something from the earlier install… so I wouldn’t call it a totally “fresh” install on my Mac.

As for the site itself, I simply logged into Flywheel via the app, and then followed the prompts to pull our production site down to local. Starting a new site isn’t something I’ve tried, but honestly that would be of little use to me since we have an existing site that I need to do local development on. I can try it for debugging purposes if you think that would be helpful.

As for whether it started loading at any point before it showed a white screen, no, as soon as I click on “View Site,” the browser launches, and I see nothing but a white screen the entire time. No amount of waiting for it to load makes any difference (I left it overnight and it neither timed out nor finished loading).

Thanks for the info @jongrall. By fresh install I had meant for the WordPress site and with knowing that you pulled it down it helps answer that.

I would suggest trying to setup a new WordPress site within Local just to see if a default setup works.

As for the loading, I think a few things would be helpful for more site level troubleshooting is if you include the sites PHP error.log (right click on site name in left sidebar > Reveal in Finder > site name directory > logs > php)

With it seeming like it’s stalling on loading, in Chrome you can open up the Network dev tools option to see if a single asset is holding things up. I’ve seen assets at the top of a document make an external call which holds up everything else.

To test in Chrome, launch the page > right click > Inspect > (the top tab sections will have an option for Network) > using Network tab, reload the page. This section will show the waterfall and if anything shows up but never completes, hover over it to see the URL. That may reveal the culprit since the wp-admin sounds to be loading.

Inspecting the network traffic in Google Chrome did the trick. I see that all supporting assets are failing to load: images, CSS, Javascript, etc… Mousing over them reveals the cause: the server is trying to fetch from a local CDN that doesn’t exist. The URLs are all prefixed with https://cdn.she-s-so-bright.local.

This is caused by a Wordpress plugin I’m using called CDN Enabler that isn’t very smart. I already had to edit its source code once before to stop it from rewriting URLs to use a CDN when deployed in Flywheel’s staging environment. Looks like I’ll have to disable it for Local also.

Disabling the plugin fixed the issue, and I had to do the same for Autoptimize’s CDN feature. A longer term solution will be forking the plugin(s) and customizing them to properly recognize the local environment. Thanks for the help, and for pointing me to Google Chrome’s Inspector - not sure why I didn’t think of that!

Looks like there’s nothing for you guys to fix on your end, but perhaps a warning about CDN/URL-rewriter plugins would be a welcome addition to your documentation.

@jongrall Awesome to hear that you got things in working shape. I hadn’t initially thought of CDN would be the culprit BUT makes total sense. I know Autoptimize can need a clear of cache when moving around in environments so that should be a good one to keep at the top of the list to check. Note, that plugin also has CDN settings in for when it minifies.

I’m encountering this same problem. Did you just disable the Autooptimize plugin inside Local environment or remove it all together? What solution or workflow have you found to get around this problem?