[Critical] [Bug] Release build fails — missing calcMeleeDamage export in utils/index.ts barrel #264

Closed
opened 2026-06-04 19:46:43 +02:00 by Anexim · 1 comment
Owner

Summary

The production build (next build) fails with a Turbopack error:

Export calcMeleeDamage doesn't exist in target module
./src/lib/game/stores/combat-actions.ts:11:1

Root Cause

combat-actions.ts line 11 imports calcMeleeDamage from '../utils' (the barrel utils/index.ts), but calcMeleeDamage is not re-exported in that barrel file.

  • Defined in: src/lib/game/utils/combat-utils.ts (line 297) — export function calcMeleeDamage(...)
  • Imported in: src/lib/game/stores/combat-actions.ts (line 11) — from '../utils'
  • Barrel export: src/lib/game/utils/index.tscalcMeleeDamage is missing

The barrel file exports calcDamage and other functions from combat-utils.ts but omits calcMeleeDamage.

Introduced By

Commit 8dde423 — "feat: implement sword/melee auto-attack system (spec §3.1, §4.3)" added the function and its usage but forgot to update the barrel export.

Impact

  • Severity: Critical — The Docker release build (Gitea CI workflow) fails completely on every push to master.
  • The dev server (next dev) may not catch this because dev mode uses lazy compilation and the code path may not be hit until the combat tick runs with an equipped sword.
  • All CI/CD pushes to master since commit 8dde423 have produced broken images.

Fix Required

Add calcMeleeDamage to the re-export block in src/lib/game/utils/index.ts that exports from ./combat-utils.

Files Involved

File Role
src/lib/game/utils/index.ts Missing barrel export (fix target)
src/lib/game/utils/combat-utils.ts Function definition (correct)
src/lib/game/stores/combat-actions.ts Import site (line 11, usage at line 263)
## Summary The production build (`next build`) fails with a Turbopack error: ``` Export calcMeleeDamage doesn't exist in target module ./src/lib/game/stores/combat-actions.ts:11:1 ``` ## Root Cause `combat-actions.ts` line 11 imports `calcMeleeDamage` from `'../utils'` (the barrel `utils/index.ts`), but `calcMeleeDamage` is **not re-exported** in that barrel file. - **Defined in:** `src/lib/game/utils/combat-utils.ts` (line 297) — `export function calcMeleeDamage(...)` ✅ - **Imported in:** `src/lib/game/stores/combat-actions.ts` (line 11) — from `'../utils'` ✅ - **Barrel export:** `src/lib/game/utils/index.ts` — `calcMeleeDamage` is **missing** ❌ The barrel file exports `calcDamage` and other functions from `combat-utils.ts` but omits `calcMeleeDamage`. ## Introduced By Commit `8dde423` — "feat: implement sword/melee auto-attack system (spec §3.1, §4.3)" added the function and its usage but forgot to update the barrel export. ## Impact - **Severity: Critical** — The Docker release build (Gitea CI workflow) fails completely on every push to `master`. - The dev server (`next dev`) may not catch this because dev mode uses lazy compilation and the code path may not be hit until the combat tick runs with an equipped sword. - All CI/CD pushes to master since commit `8dde423` have produced broken images. ## Fix Required Add `calcMeleeDamage` to the re-export block in `src/lib/game/utils/index.ts` that exports from `./combat-utils`. ## Files Involved | File | Role | |---|---| | `src/lib/game/utils/index.ts` | Missing barrel export (fix target) | | `src/lib/game/utils/combat-utils.ts` | Function definition (correct) | | `src/lib/game/stores/combat-actions.ts` | Import site (line 11, usage at line 263) |
Anexim added the ai:todo label 2026-06-04 19:46:43 +02:00
n8n-gitea was assigned by Anexim 2026-06-04 19:46:43 +02:00
Anexim added ai:in-progress and removed ai:todo labels 2026-06-04 19:50:04 +02:00
Anexim added ai:done and removed ai:in-progress labels 2026-06-04 19:52:21 +02:00
Author
Owner

Fixed. Added calcMeleeDamage to the ./combat-utils re-export block in src/lib/game/utils/index.ts.

Verified:

  • next build completes successfully (exit 0)
  • All 916 tests pass across 46 test files
  • Pre-commit hook (file size, circular deps, tests) all green
  • Pushed to master: commit 69cc8b7
Fixed. Added `calcMeleeDamage` to the `./combat-utils` re-export block in `src/lib/game/utils/index.ts`. Verified: - `next build` completes successfully (exit 0) - All 916 tests pass across 46 test files - Pre-commit hook (file size, circular deps, tests) all green - Pushed to master: commit `69cc8b7`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#264