Skip to content

Conversation

@rajk93
Copy link
Contributor

@rajk93 rajk93 commented Nov 7, 2025

fixes #5566

Problem

When using typegen with definitions containing no custom types (only RPC/runtime definitions), the generated types.ts file would be completely empty, causing TypeScript compilation errors when re-exported via export * from './types'.

Solution

Added a phantom export to the tsDef/types.hbs template to ensure the generated file always has at least one export:

  export type PHANTOM_GENERATED = 'generated';

While @jacogr mentioned #5566 (comment) using a timestamped phantom export PHANTOM_GENERATED_<Date.now()> for uniqueness, but here a static phantom export is sufficient because:

  • The file is completely auto-generated and overwritten on each build
  • No conflict risk since the phantom export is never actually imported or used

@rajk93 rajk93 marked this pull request as ready for review November 7, 2025 12:56
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.

How to make type generation work without custom definitions provided?

2 participants