-
Notifications
You must be signed in to change notification settings - Fork 1.4k
docs(debugging): add guide for finding leftover console.log statements #8203
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
base: main
Are you sure you want to change the base?
Conversation
|
309a74f to
b8b969e
Compare
gioboa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help @KyeongJooni
| // root.tsx or layout.tsx | ||
| export default component$(() => { | ||
| // Override console.log to include stack traces | ||
| useVisibleTask$(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally don't like this approach with visible tasks because you need to remember and remove them too.eslint seems to be the best way to tackle the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback @gioboa!
Thanks for the feedback! I've moved ESLint to the top as the primary recommendation. I kept the stack trace approach at the bottom since the original issue mentioned it can be helpful for identifying existing logs in codebases that are already cluttered. Added a note to remove it after debugging. Happy to adjust further if needed!
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
d353133 to
b8b969e
Compare
Reorganize the debugging documentation based on feedback: - Move ESLint rules to the top as the recommended approach - Add IDE search as a secondary option - Keep stack trace method as temporary debugging technique - Add warning notes about removing overrides after use
Fixes #7661
What is it?
Description
Added a section to the debugging guide explaining how to find leftover console.log statements using stack traces. Includes examples for both client-side components and server-side entry files, plus alternative approaches with ESLint and IDE search.
Checklist
pnpm change