Type generation and data validation problems

Typegen inspects layout metadata configured in adk.config.json to generate TypeScript types and runtime validation schemas. Validation errors occur when returned FileMaker records diverge from generated schemas.

Typegen can't read a layout

Verify that:

  • layoutName matches the FileMaker layout name exactly (case-sensitive).

  • The layout exists in the database file bound to the application.

  • The authenticated account has permission to access the layout and its fields.

  • FileMaker Pro 26.1.2 or later has the database open with Agent Access enabled.

Diagnose connection health before altering configuration files. An unreachable database and a missing layout require different remediation.

Missing fields in generated types

Typegen discovers only fields and portals placed on the designated data layout. Add missing fields to the layout in FileMaker Pro and rerun Typegen. Do not edit files under generated/ or client/ directly; subsequent Typegen runs overwrite manual edits.

Stale generated types

Rerun Typegen whenever database schema changes—including adding, renaming, or modifying fields, value lists, or portals. Updating @adk/fmdapi alone does not require running Typegen.

Runtime validation failures

Validation errors indicate that incoming FileMaker record values do not match Zod schema definitions. Compare failing values against:

  1. The field definition in FileMaker Pro.

  2. The field object placed on the data layout.

  3. The generated Zod schema under src/config/schemas/filemaker/generated/.

  4. Custom transformation overrides in the root schema file.

Correct the data in FileMaker Pro or update intentional overrides. Avoid weakening validation schemas globally to mask individual data inconsistencies.