oneie 3.6.25 → 3.6.27
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.
- package/.claude/agents/TROUBLESHOOTING.md +530 -0
- package/.claude/agents/agent-builder.md +226 -198
- package/.claude/agents/agent-claude.md +645 -0
- package/.claude/agents/agent-designer.md +166 -11
- package/.claude/agents/agent-director.md +109 -41
- package/.claude/agents/agent-frontend.md +314 -27
- package/.claude/agents/agent-quality.md +377 -0
- package/.claude/commands/chat.md +504 -0
- package/.claude/commands/create.md +134 -18
- package/.claude/commands/fast.md +531 -0
- package/.claude/commands/one.md +12 -85
- package/.claude/commands/optimize.md +74 -0
- package/.claude/commands/plan.md +420 -373
- package/.claude/commands/review.md +99 -0
- package/.claude/commands/test.md +197 -0
- package/.claude/commands/validate.md +140 -0
- package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
- package/.claude/hooks/auto-format.sh +106 -0
- package/.claude/hooks/formatting.py +187 -0
- package/.claude/hooks/ontology-validation.py +255 -0
- package/.claude/hooks/validate-imports.py +182 -0
- package/.claude/hooks/validate-ontology.py +140 -0
- package/CLAUDE.md +105 -0
- package/dist/commands/agent.d.ts +18 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +271 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/init.js +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-detection.d.ts +19 -0
- package/dist/lib/agent-detection.d.ts.map +1 -0
- package/dist/lib/agent-detection.js +87 -0
- package/dist/lib/agent-detection.js.map +1 -0
- package/dist/lib/detect.d.ts +45 -0
- package/dist/lib/detect.d.ts.map +1 -0
- package/dist/lib/detect.js +221 -0
- package/dist/lib/detect.js.map +1 -0
- package/llms.txt +257 -0
- package/one/knowledge/cascading-context-specification.md +1617 -0
- package/one/knowledge/claude-code-integration.md +1293 -0
- package/one/knowledge/development-commands.md +251 -0
- package/one/knowledge/games-english.md +691 -0
- package/one/knowledge/games.md +1082 -0
- package/one/knowledge/guidelines.md +314 -0
- package/one/knowledge/parallel-agents.md +932 -0
- package/one/knowledge/performance.md +459 -0
- package/one/knowledge/troubleshooting.md +434 -0
- package/one/things/plans/dsl-claude-code.md +1011 -0
- package/one/things/plans/npx-agent-safety.md +785 -0
- package/one/things/plans/npx-agent.md +1089 -0
- package/one/things/plans/remove-backend-development-from-agents.md +1331 -0
- package/package.json +3 -2
- package/.claude/agents/AUDIT-agent-ops-alignment.md +0 -379
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Common Issues and Solutions
|
|
3
|
+
dimension: knowledge
|
|
4
|
+
category: troubleshooting
|
|
5
|
+
tags: debugging, errors, solutions, fixes
|
|
6
|
+
related_dimensions: all
|
|
7
|
+
scope: global
|
|
8
|
+
created: 2025-11-08
|
|
9
|
+
version: 1.0.0
|
|
10
|
+
ai_context: |
|
|
11
|
+
Comprehensive troubleshooting guide for common issues in ONE platform
|
|
12
|
+
development, with solutions and preventive measures.
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Common Issues and Solutions
|
|
16
|
+
|
|
17
|
+
**Quick fixes for frequent development problems.**
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## TypeScript Errors
|
|
22
|
+
|
|
23
|
+
### Issue: TypeScript errors after schema changes
|
|
24
|
+
|
|
25
|
+
**Symptoms:**
|
|
26
|
+
- Type errors in Convex queries/mutations
|
|
27
|
+
- `_generated` types out of sync
|
|
28
|
+
- Import errors from `@/convex/_generated/api`
|
|
29
|
+
|
|
30
|
+
**Solution:**
|
|
31
|
+
```bash
|
|
32
|
+
# Regenerate Convex types
|
|
33
|
+
cd backend && npx convex dev
|
|
34
|
+
|
|
35
|
+
# Check frontend types
|
|
36
|
+
cd web && bunx astro check
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Prevention:**
|
|
40
|
+
- Always run `npx convex dev` after schema changes
|
|
41
|
+
- Wait for type generation to complete before coding
|
|
42
|
+
- Use TypeScript strict mode to catch issues early
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Authentication Issues
|
|
47
|
+
|
|
48
|
+
### Issue: Auth not working
|
|
49
|
+
|
|
50
|
+
**Symptoms:**
|
|
51
|
+
- Login fails silently
|
|
52
|
+
- Session not persisting
|
|
53
|
+
- `getUserIdentity()` returns null
|
|
54
|
+
|
|
55
|
+
**Solution:**
|
|
56
|
+
```bash
|
|
57
|
+
# 1. Check BETTER_AUTH_SECRET matches
|
|
58
|
+
# Compare web/.env.local and backend/.env.local
|
|
59
|
+
grep BETTER_AUTH_SECRET web/.env.local
|
|
60
|
+
grep BETTER_AUTH_SECRET backend/.env.local
|
|
61
|
+
|
|
62
|
+
# 2. Verify Convex deployment URL
|
|
63
|
+
grep PUBLIC_CONVEX_URL web/.env.local
|
|
64
|
+
|
|
65
|
+
# 3. Check auth configuration
|
|
66
|
+
cat backend/convex/auth.ts
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Common Causes:**
|
|
70
|
+
- `BETTER_AUTH_SECRET` mismatch between frontend and backend
|
|
71
|
+
- Wrong `PUBLIC_CONVEX_URL` in frontend
|
|
72
|
+
- Missing OAuth credentials
|
|
73
|
+
- Rate limiting triggered (check `@convex-dev/rate-limiter` logs)
|
|
74
|
+
|
|
75
|
+
**Prevention:**
|
|
76
|
+
- Use same `.env.local` template for web and backend
|
|
77
|
+
- Generate `BETTER_AUTH_SECRET` once and share it
|
|
78
|
+
- Test auth flow after any environment variable changes
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Hydration Issues
|
|
83
|
+
|
|
84
|
+
### Issue: Hydration mismatch
|
|
85
|
+
|
|
86
|
+
**Symptoms:**
|
|
87
|
+
- Console error: "Hydration failed"
|
|
88
|
+
- Component renders differently on server vs client
|
|
89
|
+
- Flash of unstyled content (FOUC)
|
|
90
|
+
|
|
91
|
+
**Solution:**
|
|
92
|
+
```astro
|
|
93
|
+
<!-- Add client:load directive to interactive components -->
|
|
94
|
+
<ShoppingCart client:load />
|
|
95
|
+
|
|
96
|
+
<!-- Or use client:only for client-only components -->
|
|
97
|
+
<ClientOnlyWidget client:only="react" />
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Common Causes:**
|
|
101
|
+
- Using browser APIs (localStorage, window) in SSR
|
|
102
|
+
- Date/time rendering (server timezone ≠ client timezone)
|
|
103
|
+
- Random values generated on server and client
|
|
104
|
+
|
|
105
|
+
**Prevention:**
|
|
106
|
+
```typescript
|
|
107
|
+
// Use client-only rendering for browser APIs
|
|
108
|
+
import { useEffect, useState } from 'react';
|
|
109
|
+
|
|
110
|
+
function BrowserComponent() {
|
|
111
|
+
const [mounted, setMounted] = useState(false);
|
|
112
|
+
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
setMounted(true);
|
|
115
|
+
}, []);
|
|
116
|
+
|
|
117
|
+
if (!mounted) return null;
|
|
118
|
+
|
|
119
|
+
// Safe to use browser APIs here
|
|
120
|
+
return <div>{localStorage.getItem('key')}</div>;
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Tailwind Styling Issues
|
|
127
|
+
|
|
128
|
+
### Issue: Tailwind styles not applying
|
|
129
|
+
|
|
130
|
+
**Symptoms:**
|
|
131
|
+
- Colors not rendering
|
|
132
|
+
- Custom theme variables not working
|
|
133
|
+
- Dark mode not switching
|
|
134
|
+
|
|
135
|
+
**Solution:**
|
|
136
|
+
```css
|
|
137
|
+
/* Ensure HSL format with hsl() wrapper */
|
|
138
|
+
@theme {
|
|
139
|
+
--color-background: 0 0% 100%; /* HSL format */
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.my-component {
|
|
143
|
+
background-color: hsl(var(--color-background)); /* hsl() wrapper */
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Common Causes:**
|
|
148
|
+
- Using OKLCH format instead of HSL
|
|
149
|
+
- Missing `hsl()` wrapper around CSS variables
|
|
150
|
+
- Using `@apply` directive (not supported in Tailwind v4)
|
|
151
|
+
- Missing `@source` directive for component files
|
|
152
|
+
|
|
153
|
+
**Prevention:**
|
|
154
|
+
- Always use HSL format: `H S% L%`
|
|
155
|
+
- Always wrap with `hsl()`: `hsl(var(--color-name))`
|
|
156
|
+
- Never use `@apply` in Tailwind v4
|
|
157
|
+
- Add `@source` directive to scan all component files
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Build Issues
|
|
162
|
+
|
|
163
|
+
### Issue: Build fails on Cloudflare
|
|
164
|
+
|
|
165
|
+
**Symptoms:**
|
|
166
|
+
- `react-dom/server` module not found
|
|
167
|
+
- Edge runtime errors
|
|
168
|
+
- SSR errors in production
|
|
169
|
+
|
|
170
|
+
**Solution:**
|
|
171
|
+
```javascript
|
|
172
|
+
// astro.config.mjs
|
|
173
|
+
export default defineConfig({
|
|
174
|
+
vite: {
|
|
175
|
+
resolve: {
|
|
176
|
+
alias: {
|
|
177
|
+
'react-dom/server': 'react-dom/server.edge'
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Common Causes:**
|
|
185
|
+
- Missing `react-dom/server.edge` alias
|
|
186
|
+
- Using Node.js-specific APIs in edge runtime
|
|
187
|
+
- Missing environment variables in Cloudflare Pages
|
|
188
|
+
|
|
189
|
+
**Prevention:**
|
|
190
|
+
- Use `react-dom/server.edge` for Cloudflare compatibility
|
|
191
|
+
- Test builds locally: `bun run build`
|
|
192
|
+
- Verify environment variables in Cloudflare dashboard
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Convex Issues
|
|
197
|
+
|
|
198
|
+
### Issue: Query not updating in real-time
|
|
199
|
+
|
|
200
|
+
**Symptoms:**
|
|
201
|
+
- `useQuery` returns stale data
|
|
202
|
+
- Changes in database not reflected in UI
|
|
203
|
+
- Real-time subscriptions not working
|
|
204
|
+
|
|
205
|
+
**Solution:**
|
|
206
|
+
```typescript
|
|
207
|
+
// Ensure using useQuery (not ConvexHttpClient)
|
|
208
|
+
import { useQuery } from "convex/react";
|
|
209
|
+
import { api } from "@/convex/_generated/api";
|
|
210
|
+
|
|
211
|
+
function MyComponent() {
|
|
212
|
+
// CORRECT: Real-time subscription
|
|
213
|
+
const data = useQuery(api.queries.things.list, { groupId });
|
|
214
|
+
|
|
215
|
+
// WRONG: Static fetch (no real-time updates)
|
|
216
|
+
// const data = await client.query(api.queries.things.list, { groupId });
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Common Causes:**
|
|
221
|
+
- Using `ConvexHttpClient` instead of `useQuery` hook
|
|
222
|
+
- Component not wrapped in `ConvexProvider`
|
|
223
|
+
- Query invalidation not triggered
|
|
224
|
+
- Index not defined for query pattern
|
|
225
|
+
|
|
226
|
+
**Prevention:**
|
|
227
|
+
- Always use `useQuery` for real-time data
|
|
228
|
+
- Wrap app in `ConvexProvider`
|
|
229
|
+
- Define indexes for all query patterns
|
|
230
|
+
- Test real-time updates during development
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Content Collections Issues
|
|
235
|
+
|
|
236
|
+
### Issue: Content not found or types missing
|
|
237
|
+
|
|
238
|
+
**Symptoms:**
|
|
239
|
+
- `getCollection()` returns empty array
|
|
240
|
+
- Type errors on `post.data` fields
|
|
241
|
+
- Content not appearing on pages
|
|
242
|
+
|
|
243
|
+
**Solution:**
|
|
244
|
+
```bash
|
|
245
|
+
# Regenerate content types
|
|
246
|
+
bunx astro sync
|
|
247
|
+
|
|
248
|
+
# Check content directory structure
|
|
249
|
+
ls -la src/content/blog/
|
|
250
|
+
|
|
251
|
+
# Verify schema matches content
|
|
252
|
+
cat src/content/config.ts
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Common Causes:**
|
|
256
|
+
- Missing `bunx astro sync` after content changes
|
|
257
|
+
- Schema doesn't match content frontmatter
|
|
258
|
+
- Content files in wrong directory
|
|
259
|
+
- Invalid YAML frontmatter
|
|
260
|
+
|
|
261
|
+
**Prevention:**
|
|
262
|
+
- Run `bunx astro sync` after adding/changing content
|
|
263
|
+
- Validate frontmatter matches schema
|
|
264
|
+
- Use TypeScript types: `CollectionEntry<"blog">`
|
|
265
|
+
- Test content rendering locally before deploying
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Multi-Tenancy Issues
|
|
270
|
+
|
|
271
|
+
### Issue: Cross-tenant data leaks
|
|
272
|
+
|
|
273
|
+
**Symptoms:**
|
|
274
|
+
- User sees data from other groups
|
|
275
|
+
- Queries return data from wrong groupId
|
|
276
|
+
- Security audit fails
|
|
277
|
+
|
|
278
|
+
**Solution:**
|
|
279
|
+
```typescript
|
|
280
|
+
// ALWAYS validate group access
|
|
281
|
+
const group = await ctx.db.get(args.groupId);
|
|
282
|
+
if (!group || group.status !== "active") {
|
|
283
|
+
throw new Error("Invalid group");
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// ALWAYS scope queries by groupId
|
|
287
|
+
const things = await ctx.db
|
|
288
|
+
.query("things")
|
|
289
|
+
.withIndex("group_type", q =>
|
|
290
|
+
q.eq("groupId", args.groupId).eq("type", args.type)
|
|
291
|
+
)
|
|
292
|
+
.collect();
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
**Common Causes:**
|
|
296
|
+
- Missing groupId validation
|
|
297
|
+
- Query without groupId scope
|
|
298
|
+
- Using wrong groupId from session
|
|
299
|
+
- Hierarchical access not implemented correctly
|
|
300
|
+
|
|
301
|
+
**Prevention:**
|
|
302
|
+
- NEVER query without groupId scope
|
|
303
|
+
- Validate group exists and is active
|
|
304
|
+
- Test with multiple groups during development
|
|
305
|
+
- Add integration tests for multi-tenancy
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Performance Issues
|
|
310
|
+
|
|
311
|
+
### Issue: Slow page loads or high JS bundle size
|
|
312
|
+
|
|
313
|
+
**Symptoms:**
|
|
314
|
+
- Lighthouse score < 90
|
|
315
|
+
- Large JavaScript bundles (> 200KB)
|
|
316
|
+
- Slow Time to Interactive (TTI)
|
|
317
|
+
|
|
318
|
+
**Solution:**
|
|
319
|
+
```astro
|
|
320
|
+
<!-- Use appropriate client directives -->
|
|
321
|
+
<HeavyComponent client:visible /> <!-- Load when visible -->
|
|
322
|
+
<SearchBox client:idle /> <!-- Load when idle -->
|
|
323
|
+
<CriticalComponent client:load /> <!-- Load immediately -->
|
|
324
|
+
|
|
325
|
+
<!-- Dynamic imports for heavy components -->
|
|
326
|
+
<script>
|
|
327
|
+
const HeavyChart = lazy(() => import('./HeavyChart'));
|
|
328
|
+
</script>
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
**Common Causes:**
|
|
332
|
+
- Overuse of `client:load` directive
|
|
333
|
+
- No code splitting
|
|
334
|
+
- Heavy libraries in client bundle
|
|
335
|
+
- No lazy loading for images/components
|
|
336
|
+
|
|
337
|
+
**Prevention:**
|
|
338
|
+
- Default to static HTML (no client directive)
|
|
339
|
+
- Use `client:idle` or `client:visible` for non-critical components
|
|
340
|
+
- Dynamic import heavy libraries
|
|
341
|
+
- Lazy load images with `loading="lazy"`
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
## Deployment Issues
|
|
346
|
+
|
|
347
|
+
### Issue: Environment variables not working in production
|
|
348
|
+
|
|
349
|
+
**Symptoms:**
|
|
350
|
+
- `process.env.VAR_NAME` is undefined
|
|
351
|
+
- API calls fail with auth errors
|
|
352
|
+
- Database connection fails
|
|
353
|
+
|
|
354
|
+
**Solution:**
|
|
355
|
+
```bash
|
|
356
|
+
# 1. Check Cloudflare Pages environment variables
|
|
357
|
+
wrangler pages deployment list --project-name=web
|
|
358
|
+
|
|
359
|
+
# 2. Add variables in Cloudflare dashboard
|
|
360
|
+
# Settings → Environment Variables
|
|
361
|
+
|
|
362
|
+
# 3. Ensure PUBLIC_ prefix for client-side vars
|
|
363
|
+
PUBLIC_CONVEX_URL=https://...
|
|
364
|
+
BETTER_AUTH_SECRET=... # Server-side only
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
**Common Causes:**
|
|
368
|
+
- Missing environment variables in Cloudflare dashboard
|
|
369
|
+
- Forgetting `PUBLIC_` prefix for client-side variables
|
|
370
|
+
- Wrong deployment environment (preview vs production)
|
|
371
|
+
- Environment variables not synced after changes
|
|
372
|
+
|
|
373
|
+
**Prevention:**
|
|
374
|
+
- Use `PUBLIC_` prefix for client-accessible variables
|
|
375
|
+
- Add all variables to Cloudflare dashboard
|
|
376
|
+
- Test in preview deployment before production
|
|
377
|
+
- Document all required environment variables
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
## Git Issues
|
|
382
|
+
|
|
383
|
+
### Issue: Merge conflicts in generated files
|
|
384
|
+
|
|
385
|
+
**Symptoms:**
|
|
386
|
+
- Conflicts in `_generated/` directory
|
|
387
|
+
- Conflicts in `package-lock.json` or `bun.lockb`
|
|
388
|
+
- Conflicts in `.astro/` cache
|
|
389
|
+
|
|
390
|
+
**Solution:**
|
|
391
|
+
```bash
|
|
392
|
+
# For generated files, prefer theirs and regenerate
|
|
393
|
+
git checkout --theirs backend/convex/_generated/
|
|
394
|
+
cd backend && npx convex dev
|
|
395
|
+
|
|
396
|
+
# For lockfiles, regenerate
|
|
397
|
+
rm bun.lockb
|
|
398
|
+
bun install
|
|
399
|
+
|
|
400
|
+
# For cache, delete and rebuild
|
|
401
|
+
rm -rf .astro/
|
|
402
|
+
bunx astro sync
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
**Prevention:**
|
|
406
|
+
- Add `_generated/` to `.gitignore` (already done)
|
|
407
|
+
- Commit lockfiles carefully
|
|
408
|
+
- Clear cache before merging: `rm -rf .astro/`
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## Quick Diagnostic Commands
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
# Check all types
|
|
416
|
+
bunx astro check && cd backend && npx convex dev
|
|
417
|
+
|
|
418
|
+
# View backend logs
|
|
419
|
+
cd backend && npx convex logs --history 50
|
|
420
|
+
|
|
421
|
+
# Test auth flow
|
|
422
|
+
cd web && bun test test/auth/
|
|
423
|
+
|
|
424
|
+
# Check environment
|
|
425
|
+
env | grep CONVEX
|
|
426
|
+
env | grep BETTER_AUTH
|
|
427
|
+
|
|
428
|
+
# Verify build
|
|
429
|
+
cd web && bun run build
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
**When in doubt, regenerate types, clear cache, and rebuild.**
|