Docker build fails with 3 errors: JSX syntax, missing module, missing file #21

Closed
opened 2026-05-18 14:32:14 +02:00 by Anexim · 2 comments
Owner

Build Failure Summary

The Docker build (RUN bun run build) fails with 3 distinct errors:


Error 1 — Invalid JSX ternary syntax in DisciplinesTab.tsx:153

File: src/components/game/tabs/DisciplinesTab.tsx
Line: 151–155

{unlockedPerks?.map((p) => (
  <li key={p} className="text-green-500">{p.replace(/-([0-9]+)$/, ' $1')}</li>
)) : (
  <li className="text-gray-400">locked</li>
)}

Problem: The ternary operator is malformed. The ) closing the .map() is followed by : instead of ?. The parser sees )) : ( and expects a closing </ tag.
Fix: Change )) : ( to )) ? null : ( (or similar), or restructure the conditional rendering.


Error 2 — Missing module ../data/disciplines in discipline-effects.ts:6

File: src/lib/game/effects/discipline-effects.ts
Line: 6

import { ALL_DISCIPLINES } from '../data/disciplines';

Problem: There is no file at src/lib/game/data/disciplines.ts or src/lib/game/data/disciplines/index.ts. The directory src/lib/game/data/disciplines/ contains individual files (base.ts, enchanter.ts, fabricator.ts, invoker.ts) but no barrel/index file that exports ALL_DISCIPLINES.
Fix: Create src/lib/game/data/disciplines/index.ts that imports from the four discipline files and exports a combined ALL_DISCIPLINES array.


Error 3 — Missing file ./tabs/ActivityLog in ActivityLogPanel.tsx:4

File: src/components/game/ActivityLogPanel.tsx
Line: 4

import { ActivityLog } from './tabs/ActivityLog';

Problem: The directory src/components/game/tabs/ contains only DisciplinesTab.tsx and index.ts — there is no ActivityLog.tsx file anywhere in the project.
Fix: Either create the missing ActivityLog.tsx component, or update ActivityLogPanel.tsx to import from the correct location (if the component exists elsewhere under a different name/path).


Files needing changes

  1. src/components/game/tabs/DisciplinesTab.tsx — fix JSX ternary on line 153
  2. src/lib/game/data/disciplines/index.tscreate new file with ALL_DISCIPLINES export
  3. src/components/game/ActivityLogPanel.tsx — fix import path or create missing ActivityLog.tsx
## Build Failure Summary The Docker build (`RUN bun run build`) fails with 3 distinct errors: --- ### Error 1 — Invalid JSX ternary syntax in `DisciplinesTab.tsx:153` **File:** `src/components/game/tabs/DisciplinesTab.tsx` **Line:** 151–155 ```tsx {unlockedPerks?.map((p) => ( <li key={p} className="text-green-500">{p.replace(/-([0-9]+)$/, ' $1')}</li> )) : ( <li className="text-gray-400">—locked—</li> )} ``` **Problem:** The ternary operator is malformed. The `)` closing the `.map()` is followed by `:` instead of `?`. The parser sees `)) : (` and expects a closing `</` tag. **Fix:** Change `)) : (` to `)) ? null : (` (or similar), or restructure the conditional rendering. --- ### Error 2 — Missing module `../data/disciplines` in `discipline-effects.ts:6` **File:** `src/lib/game/effects/discipline-effects.ts` **Line:** 6 ```ts import { ALL_DISCIPLINES } from '../data/disciplines'; ``` **Problem:** There is no file at `src/lib/game/data/disciplines.ts` or `src/lib/game/data/disciplines/index.ts`. The directory `src/lib/game/data/disciplines/` contains individual files (`base.ts`, `enchanter.ts`, `fabricator.ts`, `invoker.ts`) but no barrel/index file that exports `ALL_DISCIPLINES`. **Fix:** Create `src/lib/game/data/disciplines/index.ts` that imports from the four discipline files and exports a combined `ALL_DISCIPLINES` array. --- ### Error 3 — Missing file `./tabs/ActivityLog` in `ActivityLogPanel.tsx:4` **File:** `src/components/game/ActivityLogPanel.tsx` **Line:** 4 ```ts import { ActivityLog } from './tabs/ActivityLog'; ``` **Problem:** The directory `src/components/game/tabs/` contains only `DisciplinesTab.tsx` and `index.ts` — there is no `ActivityLog.tsx` file anywhere in the project. **Fix:** Either create the missing `ActivityLog.tsx` component, or update `ActivityLogPanel.tsx` to import from the correct location (if the component exists elsewhere under a different name/path). --- ### Files needing changes 1. `src/components/game/tabs/DisciplinesTab.tsx` — fix JSX ternary on line 153 2. `src/lib/game/data/disciplines/index.ts` — **create new file** with `ALL_DISCIPLINES` export 3. `src/components/game/ActivityLogPanel.tsx` — fix import path or create missing `ActivityLog.tsx`
Anexim added the ai:todo label 2026-05-18 14:32:14 +02:00
n8n-gitea was assigned by Anexim 2026-05-18 14:32:14 +02:00
Author
Owner

Starting work on fixing the 3 Docker build errors. Will investigate and fix all three issues.

Starting work on fixing the 3 Docker build errors. Will investigate and fix all three issues.
Author
Owner

All 3 Docker build errors fixed and verified with successful bun run build:

  1. DisciplinesTab.tsx JSX ternary — Fixed malformed )) : ( to proper ternary unlockedPerks && unlockedPerks.length > 0 ? (...) : (...). Also fixed broken relative imports (../data/disciplines/base@/lib/game/data/disciplines/base) and converted default imports to named imports matching the actual export const declarations.

  2. Missing disciplines barrel — Created src/lib/game/data/disciplines/index.ts that imports from all four discipline files and exports ALL_DISCIPLINES array.

  3. Missing ActivityLog component — Created src/components/game/tabs/ActivityLog.tsx that accepts activityLog and maxEntries props and renders the activity log entries.

Also fixed a secondary parse error: the onClick arrow function with expression body containing console.log(\Switch to ${tab.label}`)` was failing Turbopack parsing — changed to block body with braces.

Build: Compiled successfully. All pre-commit checks passed.

All 3 Docker build errors fixed and verified with successful `bun run build`: 1. **DisciplinesTab.tsx JSX ternary** — Fixed malformed `)) : (` to proper ternary `unlockedPerks && unlockedPerks.length > 0 ? (...) : (...)`. Also fixed broken relative imports (`../data/disciplines/base` → `@/lib/game/data/disciplines/base`) and converted default imports to named imports matching the actual `export const` declarations. 2. **Missing disciplines barrel** — Created `src/lib/game/data/disciplines/index.ts` that imports from all four discipline files and exports `ALL_DISCIPLINES` array. 3. **Missing ActivityLog component** — Created `src/components/game/tabs/ActivityLog.tsx` that accepts `activityLog` and `maxEntries` props and renders the activity log entries. Also fixed a secondary parse error: the `onClick` arrow function with expression body containing `console.log(\`Switch to ${tab.label}\`)` was failing Turbopack parsing — changed to block body with braces. Build: ✅ Compiled successfully. All pre-commit checks passed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#21