Skip to content

b4 check silently reports 0 routes when package.json lacks "type": "module" #685

Closed

Description

@blove

Bug

When the app root's package.json lacks "type": "module", b4 check reports success with 0 routes discovered instead of diagnosing the problem. The tsx loader yields CommonJS interop for the route modules, inferRouteKind returns null for each, and the routes are silently dropped. This is the most likely first-run failure for a new app root and it presents as "everything is fine".

Repro

  1. New app root with routes/assistant.ts exporting an agent, package.json without "type": "module".
  2. b4 check → 0 routes discovered, exit 0.

Proposal

  • Fail (or at least warn) when a file in routes/ yields no recognisable export, naming the file and the likely cause.
  • Detect the missing "type": "module" in the app root and report it explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions