Open tuckergol opened 3 months ago
Great frontend example!!! Missing step to debug all the way to the backend.
Well-organized discussion, and written examples of frontend debugging that correlate with screenshots. Could include more related to backend endpoint, nonetheless exceptionally well done. 1.85/2
Theme Feature Debugging - FETCH ERROR EXAMPLE
I attempted to recreate a basic problem that I had surprisingly frequently encountered during the development of my Theme-Changing feature due to previous my lack of experience debugging: difficulty with managing endpoints and Fetch API (trouble establishing connection between backend and frontend).
I simulated the issue described above by doing the following: below is what the port should be for fetching the endpoint in the backend that allows my theme changing/settings changing feature to work.
Here is me changing it to an incorrect port, just 800 rather than 8008 in this case. This is to break the functionality of the feature and simulate/replicate similar issues I faced during the real development of my feature.
Using the breakpoint we put on fetch and the errors we get alongside both in the frontend console (bottom of screen capture) and on the site itself (red text above bottom half of split screen), we can pinpoint the problem more directly as being with fetch.
We resolve this problem by inspecting the breakpoint (fetch) while debugging more closely and concluding that the problem is due to an incorrect port to the backend, which should be 8008, not 800. Below is the same "Save Settings" button input action following adjusting the port back to 8008.
Result of attempting Theme Change following problem solving: