-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix is_decoupled() warning when frontend is running on different port #57
Conversation
I'm looking into the failing unit tests:
I can replicate the same error locally in |
I can confirm the issue is related to the latest release Stepping through the code, the problem with vip-decoupled-bundle/tests/bootstrap.php Line 51 in d334dd1
By stepping into that code locally in This recent issue in Gutenberg WordPress/gutenberg#41780 is likely related. There has been an implementation change on how I'm looking into getting this solved to fix tests locally and for this repo. |
Okay, I think this is fine to leave broken, as it'll resolve itself once WordPress/wordpress-develop@fdb6e13 makes it into a WordPress release. This is ready for review despite test failures. Here's some more information on the problem and other solutions we could use: ProblemThis is why testing is currently broken:
SolutionsHardcode WordPress versionThis can be solved by specifying a core version in {
"plugins": [
"."
],
"config": {},
+ "core": "WordPress/WordPress#6.0.1"
} I can confirm that this fixes tests to run successfully in our repository. However, I don't believe we want to pin to a specific version and possibly start failing for legitimate reasons on newer versions of WordPress without knowing. Change the way
|
Thanks for the deep investigation and write-up!
I understand the drawbacks, but I'd recommend pursuing this strategy to fix tests, while opening a separate PR that reverts it, that is ready to merge once the issue is fixed upstream. |
@chriszarate This is ready for another review!
Good idea! I opened this PR which contains a revert commit for those changes. I've also removed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I'm working on adding
wp-env
config to vip-go-nextjs-skeleton.wp-env
runs WordPress by default usinglocalhost:8888
, with the NextJS skeleton frontend running onlocalhost:3000
. Since these are both on the same host, this triggers an admin warning fromis_decoupled()
:However,
home_url()
does point to a decoupled frontend: the frontend and backend are just running on different ports. This adds a small change tois_decoupled()
to take the port into account before showing a warning and otherwise treating the site as improperly configured.