You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/src/routes/docs/(qwikcity)/guides/debugging/index.mdx
+79-2Lines changed: 79 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,9 @@ title: Debugging | Introduction
3
3
description: Learn a few debugging tips to streamline your journey with Qwik.
4
4
contributors:
5
5
- gioboa
6
-
updated_at: '2025-08-08T00:00:00Z'
7
-
created_at: '2025-08-08T00:00:00Z'
6
+
- KyeongJooni
7
+
updated_at: '2025-12-13T00:00:00Z'
8
+
created_at: '2025-12-13T00:00:00Z'
8
9
---
9
10
# Debugging
10
11
@@ -19,3 +20,79 @@ If it guesses wrong, no biggie! Just give Qwik a hint by setting the `LAUNCH_EDI
19
20
For example, if you're on a Mac and use VS Code, you'd type `export LAUNCH_EDITOR=code` in your terminal.
20
21
21
22
Under the hood [launch-editor library](https://github.com/yyx990803/launch-editor/tree/master) is used, here are the [supported editors](https://github.com/yyx990803/launch-editor/tree/master?tab=readme-ov-file#supported-editors)
23
+
24
+
## Finding leftover `console.log` statements
25
+
26
+
When working on larger codebases, you might occasionally leave `console.log` statements in your code unintentionally. These can clutter your terminal output, and it's often difficult to identify which file and line number produced each log message.
27
+
28
+
### Using stack traces in client-side components
29
+
30
+
You can override `console.log` to include stack trace information in your component code. For example, in your root component or a layout component:
Now when you call `console.log("something")`, you'll see the stack trace pointing to the exact location where the log was called, making it much easier to locate and remove leftover debug statements.
53
+
54
+
### Using stack traces in server-side entry files
55
+
56
+
For entry files like `entry.express.tsx`, `entry.dev.tsx`, or `entry.preview.tsx`, you can override `console.log` at the module level:
57
+
58
+
```tsx
59
+
// entry.express.tsx or entry.dev.tsx or entry.preview.tsx
> **Note:** The filter regex should be adjusted based on your specific build setup. Common patterns to filter out include `.vite`, `.main.jsx`, `node_modules`, and `internal` paths.
74
+
75
+
### Using ESLint rules
76
+
77
+
You can configure ESLint to warn or error on `console.log` statements in production code:
0 commit comments