Skip to content

Enums are not getting rendered correctly #3003

@ritz078

Description

@ritz078

Expected Behavior

Enums should be rendered correctly if exported via an object

Actual Behavior

There are two different issues depending on the way we write our enums:

  • If the enum is written in separate file, the enum is rendered as a variable.
  • If the enum is written in the same file, it is identified as an enum but the page is blank except the title.

Steps to reproduce the bug

enums.ts

/**
 * This is a custom enum that is exported as a constant object.
 * 
 * @enum
 */
export const CustomEnum = {
    /** A */
    A: "A",
} as const;

index.ts

import { CustomEnum } from "./enums";

/**
 * This is a second custom enum that is exported as a constant object.
 * 
 * @enum
 */
const CustomEnum2 = {
    ...CustomEnum,
    D: "D",
} as const;

/** @namespace */
export const ExportedObject = {
    CustomEnum,
    CustomEnum2
}

This renders like the following:

2025-08-25.at.13.30.43.-.Coffee.Orca.mp4

As you can see:

  • CustomEnum2 is identified as an enum but the dedicated page is blank.
  • CustomEnum is identified as a variable.

Environment

  • Typedoc version: 0.28.11
  • TypeScript version: 5.9.2
  • Node.js version: 22.11.0
  • OS: MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions