@nhonh/react-debugger 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,416 @@
1
+ # Troubleshooting Guide
2
+
3
+ Solutions to common issues with React Debugger Extension.
4
+
5
+ ---
6
+
7
+ ## Table of Contents
8
+
9
+ 1. [Installation Issues](#installation-issues)
10
+ 2. [Extension Not Working](#extension-not-working)
11
+ 3. [React Not Detected](#react-not-detected)
12
+ 4. [Redux Not Detected](#redux-not-detected)
13
+ 5. [Performance Issues](#performance-issues)
14
+ 6. [Data Not Showing](#data-not-showing)
15
+ 7. [Error Messages](#error-messages)
16
+
17
+ ---
18
+
19
+ ## Installation Issues
20
+
21
+ ### NPX command fails
22
+
23
+ **Error:**
24
+ ```
25
+ npm ERR! code ENOENT
26
+ npm ERR! syscall spawn
27
+ ```
28
+
29
+ **Solution:**
30
+ 1. Update Node.js to version 18+
31
+ 2. Clear npm cache: `npm cache clean --force`
32
+ 3. Try again: `npx @nhonh/react-debugger`
33
+
34
+ ---
35
+
36
+ ### "Permission denied" error
37
+
38
+ **Error:**
39
+ ```
40
+ EACCES: permission denied
41
+ ```
42
+
43
+ **Solution:**
44
+ ```bash
45
+ # Use a different directory
46
+ npx @nhonh/react-debugger ~/Desktop/react-debugger
47
+
48
+ # Or fix permissions
49
+ sudo chown -R $USER ~/.npm
50
+ ```
51
+
52
+ ---
53
+
54
+ ### Extension won't load in Chrome
55
+
56
+ **Symptoms:**
57
+ - "Load unpacked" button doesn't work
58
+ - Error: "Manifest file is missing or unreadable"
59
+
60
+ **Solutions:**
61
+
62
+ 1. **Check you selected the correct folder**
63
+ - Should contain `manifest.json`
64
+ - Not the parent folder
65
+
66
+ 2. **Re-download**
67
+ ```bash
68
+ rm -rf ./react-debugger
69
+ npx @nhonh/react-debugger ./react-debugger
70
+ ```
71
+
72
+ 3. **Check Chrome version**
73
+ - Requires Chrome 88+
74
+ - Update if needed
75
+
76
+ ---
77
+
78
+ ## Extension Not Working
79
+
80
+ ### Tab doesn't appear in DevTools
81
+
82
+ **Solutions:**
83
+
84
+ 1. **Refresh the page** after loading extension
85
+
86
+ 2. **Close and reopen DevTools** completely
87
+
88
+ 3. **Check extension is enabled**
89
+ - Go to `chrome://extensions/`
90
+ - Ensure toggle is ON
91
+
92
+ 4. **Check for conflicts**
93
+ - Disable other React extensions temporarily
94
+ - Especially "React Developer Tools"
95
+
96
+ ---
97
+
98
+ ### "Extension context invalidated" error
99
+
100
+ **Cause:** Extension was updated/reloaded while DevTools was open.
101
+
102
+ **Solution:**
103
+ 1. Close DevTools
104
+ 2. Close the tab
105
+ 3. Reopen the page and DevTools
106
+
107
+ ---
108
+
109
+ ### Recording badge shows "Paused"
110
+
111
+ **Solution:**
112
+ 1. Click the Start/Stop button to enable recording
113
+ 2. Refresh the page
114
+ 3. Check if the page has React
115
+
116
+ ---
117
+
118
+ ## React Not Detected
119
+
120
+ ### "Waiting for React..." message
121
+
122
+ **Possible causes:**
123
+
124
+ 1. **Page doesn't use React**
125
+ - Check with: Open console, type `window.React`
126
+ - If undefined, page isn't using React
127
+
128
+ 2. **React version too old**
129
+ - Requires React 16+ (Fiber architecture)
130
+ - React 15 and below not supported
131
+
132
+ 3. **React loaded after page**
133
+ - Wait for full page load
134
+ - Try refreshing
135
+
136
+ 4. **Production build without DevTools**
137
+ - Some builds strip React globals
138
+ - Check `__REACT_DEVTOOLS_GLOBAL_HOOK__`
139
+
140
+ **Debug steps:**
141
+ ```javascript
142
+ // In browser console:
143
+ console.log('React:', typeof React);
144
+ console.log('DevTools Hook:', !!window.__REACT_DEVTOOLS_GLOBAL_HOOK__);
145
+
146
+ // Find React root
147
+ const root = document.getElementById('root');
148
+ const keys = Object.keys(root);
149
+ console.log('Fiber keys:', keys.filter(k => k.includes('react')));
150
+ ```
151
+
152
+ ---
153
+
154
+ ### Works on some sites but not others
155
+
156
+ **Possible reasons:**
157
+
158
+ 1. **Shadow DOM** - React inside Shadow DOM is harder to detect
159
+
160
+ 2. **Iframes** - React in iframes has separate context
161
+
162
+ 3. **Server Components** - RSC in Next.js 13+ may not show client components
163
+
164
+ 4. **Micro-frontends** - Multiple React instances
165
+
166
+ ---
167
+
168
+ ## Redux Not Detected
169
+
170
+ ### Redux tab shows "Redux not detected"
171
+
172
+ **Check these in order:**
173
+
174
+ 1. **Is Redux actually used?**
175
+ ```javascript
176
+ // In console:
177
+ console.log(window.__REDUX_DEVTOOLS_EXTENSION__);
178
+ console.log(window.store);
179
+ ```
180
+
181
+ 2. **Expose store for debugging**
182
+ ```jsx
183
+ // In your app's store setup
184
+ const store = configureStore({ reducer: rootReducer });
185
+
186
+ if (process.env.NODE_ENV === 'development') {
187
+ window.store = store;
188
+ }
189
+ ```
190
+
191
+ 3. **Install Redux DevTools Extension**
192
+ - [Chrome Web Store](https://chrome.google.com/webstore/detail/redux-devtools)
193
+ - Our extension can use its connection
194
+
195
+ 4. **Use DevTools enhancer**
196
+ ```jsx
197
+ import { configureStore } from '@reduxjs/toolkit';
198
+
199
+ // RTK automatically connects to DevTools
200
+ const store = configureStore({
201
+ reducer: rootReducer,
202
+ devTools: process.env.NODE_ENV !== 'production',
203
+ });
204
+ ```
205
+
206
+ ---
207
+
208
+ ### Redux detected but state is empty
209
+
210
+ **Cause:** Store might be created but not yet populated.
211
+
212
+ **Solutions:**
213
+ 1. Wait for app to initialize
214
+ 2. Dispatch an action to trigger update
215
+ 3. Check if store is the correct instance
216
+
217
+ ---
218
+
219
+ ## Performance Issues
220
+
221
+ ### Extension makes page slow
222
+
223
+ **Solutions:**
224
+
225
+ 1. **Pause recording** when not debugging
226
+ - Click the Stop button
227
+
228
+ 2. **Disable React Scan** when not needed
229
+ - Visual overlay has overhead
230
+
231
+ 3. **Clear old data**
232
+ - Click "Clear" in Timeline
233
+ - Reduces memory usage
234
+
235
+ 4. **Limit history**
236
+ - Extension keeps last 2000 events
237
+ - Old events auto-purge
238
+
239
+ ---
240
+
241
+ ### DevTools panel is slow/laggy
242
+
243
+ **Solutions:**
244
+
245
+ 1. **Filter events** - Show only what you need
246
+
247
+ 2. **Collapse sections** - In Redux state tree
248
+
249
+ 3. **Reduce timeline scope** - Clear frequently
250
+
251
+ 4. **Close other DevTools tabs** - Elements, Network, etc.
252
+
253
+ ---
254
+
255
+ ## Data Not Showing
256
+
257
+ ### Timeline is empty
258
+
259
+ **Checklist:**
260
+ - [ ] Recording is enabled (green badge)
261
+ - [ ] React is detected
262
+ - [ ] You interacted with the page
263
+ - [ ] Correct tab is selected (check tabId)
264
+
265
+ **Try:**
266
+ 1. Click in the page to trigger events
267
+ 2. Change state in your app
268
+ 3. Check filter buttons aren't hiding events
269
+
270
+ ---
271
+
272
+ ### Performance metrics show N/A
273
+
274
+ **Cause:** Metrics require Navigation Timing API.
275
+
276
+ **This happens when:**
277
+ - Page is in an iframe
278
+ - Page was restored from cache
279
+ - DevTools opened after load
280
+
281
+ **Solution:** Hard refresh: `Cmd+Shift+R` / `Ctrl+Shift+R`
282
+
283
+ ---
284
+
285
+ ### Memory tab shows no data
286
+
287
+ **Requirements:**
288
+ - `performance.memory` API (Chrome only)
289
+ - Not available in Firefox/Safari
290
+
291
+ **Check:**
292
+ ```javascript
293
+ console.log(performance.memory); // Should show object
294
+ ```
295
+
296
+ ---
297
+
298
+ ## Error Messages
299
+
300
+ ### "Cannot read property 'X' of undefined"
301
+
302
+ **Where it occurs:** Usually in Panel when data is malformed.
303
+
304
+ **Solutions:**
305
+ 1. Refresh the page
306
+ 2. Reload the extension
307
+ 3. Report bug if persistent
308
+
309
+ ---
310
+
311
+ ### "Extension context invalidated"
312
+
313
+ **Cause:** Extension reloaded while DevTools open.
314
+
315
+ **Solution:**
316
+ 1. Close DevTools completely
317
+ 2. Refresh the page
318
+ 3. Reopen DevTools
319
+
320
+ ---
321
+
322
+ ### "Manifest version 2 is deprecated"
323
+
324
+ **Note:** This is a warning, not an error. Extension still works.
325
+
326
+ Future versions will migrate to Manifest V3.
327
+
328
+ ---
329
+
330
+ ### Console errors from extension
331
+
332
+ **Safe to ignore:**
333
+ - `DevTools failed to load SourceMap`
334
+ - `Could not establish connection`
335
+
336
+ **Report if you see:**
337
+ - `Uncaught TypeError` from panel.js
338
+ - `Uncaught ReferenceError` from inject.js
339
+
340
+ ---
341
+
342
+ ## Still Having Issues?
343
+
344
+ ### Debug Mode
345
+
346
+ Enable verbose logging:
347
+ ```javascript
348
+ // In browser console
349
+ localStorage.setItem('REACT_DEBUGGER_DEBUG', 'true');
350
+ // Then refresh
351
+ ```
352
+
353
+ ### Collect Debug Info
354
+
355
+ When reporting a bug, include:
356
+
357
+ 1. **Browser & version**
358
+ ```
359
+ chrome://version/
360
+ ```
361
+
362
+ 2. **Extension version**
363
+ - Shown in header: "v1.0.0"
364
+
365
+ 3. **React version**
366
+ - Shown when detected
367
+
368
+ 4. **Console errors**
369
+ - Right-click panel → Inspect
370
+ - Copy errors from Console
371
+
372
+ 5. **Steps to reproduce**
373
+ - What you did
374
+ - What you expected
375
+ - What happened
376
+
377
+ ### Report a Bug
378
+
379
+ [Open an issue on GitHub](https://github.com/hoainho/react-debugger-extension/issues/new)
380
+
381
+ Include:
382
+ - Debug info above
383
+ - Screenshots if helpful
384
+ - Minimal reproduction if possible
385
+
386
+ ---
387
+
388
+ ## FAQ
389
+
390
+ ### Q: Does this work with Next.js?
391
+
392
+ **A:** Yes! Works with any React framework:
393
+ - Next.js
394
+ - Remix
395
+ - Gatsby
396
+ - Create React App
397
+ - Vite
398
+
399
+ ### Q: Does this work in Firefox?
400
+
401
+ **A:** Currently Chrome/Chromium only. Firefox support planned.
402
+
403
+ ### Q: Is my data sent anywhere?
404
+
405
+ **A:** No. All data stays in your browser. The extension:
406
+ - Has no analytics
407
+ - Makes no network requests (except download)
408
+ - Stores nothing persistently
409
+
410
+ ### Q: Will this slow down production?
411
+
412
+ **A:** The extension only activates in DevTools. It doesn't affect production users who don't have it installed.
413
+
414
+ ### Q: Can I use this with React Native?
415
+
416
+ **A:** No. This is for React DOM (web) only.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nhonh/react-debugger",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Advanced debugging & performance optimization tool for ReactJS applications - Chrome Extension",
5
5
  "author": "NhoNH",
6
6
  "license": "MIT",
@@ -10,7 +10,9 @@
10
10
  },
11
11
  "files": [
12
12
  "bin/",
13
- "src/"
13
+ "src/",
14
+ "docs/",
15
+ "README.md"
14
16
  ],
15
17
  "keywords": [
16
18
  "react",
@@ -24,11 +26,11 @@
24
26
  ],
25
27
  "repository": {
26
28
  "type": "git",
27
- "url": "git+https://github.com/nhonh/react-debugger-extension.git"
29
+ "url": "git+https://github.com/hoainho/react-debugger-extension.git"
28
30
  },
29
- "homepage": "https://github.com/nhonh/react-debugger-extension#readme",
31
+ "homepage": "https://github.com/hoainho/react-debugger-extension#readme",
30
32
  "bugs": {
31
- "url": "https://github.com/nhonh/react-debugger-extension/issues"
33
+ "url": "https://github.com/hoainho/react-debugger-extension/issues"
32
34
  },
33
35
  "engines": {
34
36
  "node": ">=18.0.0"
package/src/install.js CHANGED
@@ -3,7 +3,7 @@ import fs from 'node:fs/promises';
3
3
  import path from 'node:path';
4
4
  import decompress from 'decompress';
5
5
 
6
- const GITHUB_REPO = 'nhonh/react-debugger-extension';
6
+ const GITHUB_REPO = 'hoainho/react-debugger-extension';
7
7
  const RELEASE_TAG = 'latest';
8
8
 
9
9
  async function getLatestReleaseUrl() {