Skip to content

fix failing build#30

Merged
heinrich10 merged 3 commits into
amkjs:mainfrom
heinrich10:fix/failing_build
Jun 12, 2026
Merged

fix failing build#30
heinrich10 merged 3 commits into
amkjs:mainfrom
heinrich10:fix/failing_build

Conversation

@heinrich10

Copy link
Copy Markdown
Member

What?

Fixes TypeScript compilation errors that caused npm run build to fail.

Why?

The project build was broken after stricter TypeScript/ESLint type checking was introduced. Three files no longer compiled:

  • scripts/migrate.ts — Kysely's Migrator returns error as unknown, but the local variable was typed Error | undefined.
  • test/api_tests/helper.ts — The mocked response body was typed as Record<string, unknown>, which prevented downstream casts to PaginatedResponse<T>.
  • test/api_tests/person.test.tsbody.errors is optional (unknown[] | undefined), so accessing .length directly violated strict null checks.

How?

  • Updated error type to unknown in scripts/migrate.ts.
  • Changed the response body type to unknown in test/api_tests/helper.ts.
  • Replaced body.errors.length with body.errors?.length in test/api_tests/person.test.ts.

Testing?

  • npm run build
  • npm run lint
  • npm test ✅ (32/32 tests passing)

Screenshots (optional)

N/A

Anything Else?

N/A

AI Summary (optional)

Fixed TypeScript build errors by aligning variable types with Kysely's API and applying optional chaining for nullable error arrays.

@heinrich10
heinrich10 merged commit dbe038e into amkjs:main Jun 12, 2026
3 checks passed
@heinrich10
heinrich10 deleted the fix/failing_build branch June 12, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant