Closed Palanikannan1437 closed 1 year ago
Thank you, @Palanikannan1437, for the first PR. This PR can be merged, but I think this change might not be required ATM.
The Note
mentioned here takes care of the use case where the developer needs to have a fully custom development environment setup with their different IPs.
Note: Please replace the "localhost" with your static IP if you are doing environment setup on your VM.
So for developers facing the issue in the link you shared, they can simply run the command as sh startdevenv.sh 127.0.0.1
, and the script takes care of it all.
PS. And an interesting fact if you do ping localhost
, you will see that it will give the 127.0.0.1
on your notebook.
Please feel free to ask me anything if you do not understand any part in here.
Thank you!
PS. And an interesting fact if you do
ping localhost
, you will see that it will give the127.0.0.1
on your notebook.
Ohh yeah, I did know that...hence as a developer I assumed that localhost / 127.0.0.1 would work the same. And hence was stuck in figuring out why the heck wasn't this working out 😅.....then just to be sure I searched up google and found the fix
I do understand the note
would take care of this, but this is such a weird bug...so maybe updating the doc would be beneficial!
So I believe if we do change localhost to 127.0.0.1, it'll benefit a lot of future contributors from getting stuck at this bug
Oh, that's great. Ok, let's have these changes merged for any other contributor facing the same issue as you did. The final say would be from @Sing-Li
Thank you!
Hmm. Thanks for your contribution here. However, I really don't think it is a common problem. (systems where 127.0.0.1 is not equal to localhost) You may want to investigate your system to see what has changed from default. We will close this PR.
Hmm. Thanks for your contribution here. However, I really don't think it is a common problem. (systems where 127.0.0.1 is not equal to localhost) You may want to investigate your system to see what has changed from default. We will close this PR.
Ohhh, I'm not sure if this is system specific but rather a bug with NextJS and strapi... anyways thanks 😄
Suggested Fix/Changes
Persisting to this bug in which NextJS causes errors connecting with strapi due to the url name "localhost", I've updated the url to 127.0.0.1 instead. This way NextJS plays well with strapi in local dev environments! Cheers!
Reference to the bug: https://stackoverflow.com/questions/71836634/strapi-fetcherror-request-to-http-localhost1337-api-events-failed-reason-c