Ok, after digging around I fixed it! It turned out to be related to the Autoptimize plugin. A couple of settings I tweaked on it were:
JS, CSS & HTML Tab -> Exclude scripts from Autoptimize -> Added wp-includes/js/dist/
Extra Tab -> Unchecked ‘Remove Emojis’
Not sure if both or either one were the fix but that was it.
Thank you for the awesome plugin 🙂
Alright. It seems I can’t edit this one so should I create a new topic?
They’re adult websites so I’m not sure if it’s ok to post them here! They both have the same theme and plugins. Also found that the reason it might not be getting the /wp-json/ folder is because it also shows the following errors on page load:
Uncaught ReferenceError: wp is not defined
Uncaught ReferenceError: _ is not defined
But interestingly when the page is loaded both are defined and visible through the console.