Skip to content

@wordpress/env: Loopback requests fail #20569

@noisysocks

Description

@noisysocks

Describe the bug
WordPress isn't able to complete a loopback request when running under wp-env.

To reproduce

  1. npx wp-env start
  2. Navigate to http://localhost:8888/wp-admin/site-health.php

There's two errors related to this:

  • The REST API encountered an error
  • Your site could not complete a loopback request

Expected behavior
There should only be one critical error (the one about debug mode.)

Additional context
WordPress is trying to make a request to http://localhost:8888 from the underlying Docker container but this fails because Apache is listening on port 80. One solution would be to set up the docker-compose.yml config to map localhost to the host machine.

Metadata

Metadata

Assignees

Labels

[Status] In ProgressTracking issues with work in progress[Tool] Env/packages/env[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions