-
Notifications
You must be signed in to change notification settings - Fork 136
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
[faustwp] WordPress URL validation fail when both front-end URL and WP URL are on localhost #1884
Comments
Hey @miacias thank you for the report. The code related to this check is located in the Plugin The code that checks the domain is here:
It checks the domains of both the frontend url and WordPress url do not match. I think when both point to localhost it fails. Maybe there should be an exception for localhost or check the ports as well? A solution for this is to change your Wordpress url to point to a different local domain by changing the /etc/hosts file for localhost to point to a custom domain. Local does this automatically for us for example:
|
I agree that a quick workaround this bug would be to swap out the WP URL, but I fully agree that there should be a localhost exception made, especially because it is no longer backwards compatible. Thanks for pointing me to the right code snippet! |
@miacias We just pushed a new plugin release v1.3.1 providing the fix for this issue and should be available soon. Let us know if you find any other issues. |
Hi @theodesp, thanks for reaching out! I just tested with @faustwp/cli v3.0.2, @faustwp/core v3.0.1, and Faust.js WP plugin v1.3.1, and on first run through, everything runs as intended! Thanks, I will touch base here if I find anything. |
Description
Version Upgrade Bug Scenario
After starting a project using the Faustjs.org Getting Started npx command,
connecting it to a LocalWP Atlas spin up (Local v9.0.2+6676; Atlas Add-on v1.7.2), and then deleting
/node_modules
andpackage-lock.json
files and upgrading Next to v14, Faust to v3, and React and react-dom to v18, Faustjs no longer functions as intended. On startupnpm run dev
, the app crashes with this error:Error message
The front end Node environment runs on localhost:3000 and LocalWP environment runs on localhost:10010. There is no code, regex or otherwise, within Faustjs
validateNextWordPressUrl.js
that actually compares the front end Node URL and the WP URL, so the error message implying that the two URLs match is somewhat misleading. There is some other cause to the Bad Request that I have unfortunately been unable to identify as of yet.Environment:
The Local
/app
directory points to an exterior folder with the Faustjs Getting Started sample project instead of Local's own/app-node
folder. In this example, Faustjs starts up with v1 and Next on v12.The
.env.local
file in the root of the Getting Started containsand the WP Admin Faust Settings page contains
Front-end site URL: http://localhost:3000
.Steps to reproduce
Debugging hints
After some testing in Faustjs node_modules,
validateFaustEnvVars.js
returns status 200 and then passes tovalidateNextWordPressUrl.js
which is returning 400, bad request with no other details.When updating from older versions to the newer version, this error appears consistently.
Original:
updated (breaking):
After reverting Faustjs to v1.2.0 where the validation does not exist yet (but still keeping Next v14 and React v18 upgrades), the app runs without issue.
Additional context
No response
@faustwp/core Version
3.0.1
@faustwp/cli Version
3.0.1
FaustWP Plugin Version
1.2.3
WordPress Version
6.5.3
Additional environment details
No response
Please confirm that you have searched existing issues in the repo.
The text was updated successfully, but these errors were encountered: