/learn Profile Requests and Console Behaviour
See original GitHub issueDescribe the bug
- It appears a
console.log()
was accidentally left in theProfile.js
script. - A request to my/(a user’s) page-data is returning a 404.
To Reproduce Steps to reproduce the behavior:
- Go to https://www.freecodecamp.org/learn
- Open DevTools
- See log
true
orfalse
in console, due to:console.log(showDonation);
- File: https://github.com/freeCodeCamp/freeCodeCamp/blob/master/client/src/components/profile/Profile.js
- Line 126
- See error in console as in picture below.
Expected behavior No Errors, no logs.
Screenshots
Desktop (please complete the following information):
- OS: Windows 10
- Browser: Chrome
- Version: 83.0.4103.97
Additional Info I believe the:
‘progress updates processed where possible’
Is useful, and should stay.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
console.profile() - Web APIs - MDN Web Docs
The console.profile() starts recording a performance profile (for example, the Firefox performance tool). You can optionally supply an argument ...
Read more >Network features reference - Chrome Developers
Discover new ways to analyze how your page loads in this comprehensive reference of Chrome DevTools network analysis features.
Read more >Application Load Balancers - AWS Documentation
A load balancer serves as the single point of contact for clients. Clients send requests to the load balancer, and the load balancer...
Read more >Python & APIs: A Winning Combo for Reading Public Data
In this tutorial, you'll learn what APIs are and how to consume them using ... You can install requests by running the following...
Read more >Scripting in Postman
js that allows you to add dynamic behavior to requests and collections. This allows you to write API tests, build requests that can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, git blame @ahmadabdolsaheb and me for missing it in the QA. Reference: https://github.com/freeCodeCamp/freeCodeCamp/blame/f6aaa5f38a37c6739291ca51790a1e660aec182c/client/src/components/profile/Profile.js#L126
A PR is welcome to remove this and any other rogue logs.
This is an expected side-effect of us using Gatsby’s routing to query and get the user profile available at
/your-username
.Essentially, when you hit
/some-path
, we first let Gatsby check in the static files if something is available at that path, if not we query the API to lookup there for a username. If both conditions fail, we would render an actual 404 page.But for this to work the status code 404 is sort of abused. Its hacky but there is no way around this to the best of my knowledge.
Just to clarify, this should be left as is.
@Sky020 There’s nothing to apologise for. So, my position is just that debugging messages are things that should be shown to developers, rather than users (if possible). Essentially because that information is intended to help find and fix bugs, which isn’t something a user should be expected to do.
In this case ‘progress updates processed where possible’ mostly just indicates that you’ve navigated to a challenge, so I don’t think it’s useful.
console.warn('unable to process progress updates', err.message)
seems worth showing, but only because we don’t have access to this information with a remote error logger (Sentry in our case).