TypeDoc Monorepo: Failed to convert one or more packages, result will not be merged together

It’s my first week as a junior in a frontend team and I was tasked with figuring out how to implement Typedoc in our monorepository to generate documentation for it. They told me to first try and document 2-3 components just to see how it works and also as an overall introduction with the code that I’m going to be working on in the future and then we can move on to documenting all of it. However, I have some trouble generating any Typedoc documentation…

I followed the instructions for Monorepos/Workspaces from the official documentation. There they have put a git repo as an example setup, which I followed closely for the implementation in our repo.

Here is a rough structure of our monorepository:
└── PROJECT-NAME/
├── packages/
│ ├── components/
│ │ ├── BarChart
│ │ ├── Chart
│ │ ├── Button
│ │ ├── Filter
│ │ └── etc
│ ├── libs/
│ ├── shared-internal/
│ └── types/
├── package.json
├── package-lock.json
├── tsconfig.json
├── typedoc.json
├── tsconfig.base.json
└── typedoc.base.jsonc

Here is what I have in my root level json files:
In the scripts in package.json i adde this script:
"docs": "typedoc --tsconfig tsconfig.base.json --out docs"

tsconfig.json:

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "resolveJsonModule": true,
    "paths": {
      "libs/*": [
        "./packages/libs/*"
      ],
      "components/*": [
        "./packages/components/*"
      ],
      "types/*": [
        "./packages/types/*"
      ]
    },
    "allowSyntheticDefaultImports": true,
    "allowJs": true,
    "esModuleInterop": true
  },
  "include": [
    "./packages/**/*",
    "packages/types.ts"
  ],
  "exclude": [
    "node_modules",
    "**/__tests__/*"
  ],
  "typeRoots": [
    "node_modules/@types"
  ],
  "files": [],
  "references": [
    {
      "path": "./packages/components/Filter"
    }
  ],
  "composite": true,
  // These options are necessary so that TypeDoc can resolve references across packages
  "declaration": true,
  "declarationMap": true
}

tsconfig.base.json:

{
  "compilerOptions": {
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "strict": true,
    "composite": true,
    "declaration": true,
    "declarationMap": true
  }
}

typedoc.json:

{
    "entryPoints": [
        "./packages/components/Filter"
    ],
    "name": "Packages Example",
    "entryPointStrategy": "packages",
    "includeVersion": false,
    "packageOptions": {
        "includeVersion": true,
        "entryPoints": [
            "./packages/components/Filter"
        ]
    },
    "logLevel": "Verbose"
}

typedoc.base.json:

{
    "$schema": "https://typedoc.org/schema.json",
    "includeVersion": true
}

I am currently just focusing on generating a documentation for the Filter component. Here is what’s inside the Filter folder:
└── Filter/
├── src/
│ └── index.ts
├── package.json
├── tsconfig.json
└── typedoc.json
Here is what I have in my Filter json files:
tsconfig.json:

{
  "extends": "../../../tsconfig.json",
  "compilerOptions": {
    "outDir": "dist",
    // "baseUrl": "../../../",
    "paths": {
      "components/*": [
        "./packages/components/*"
      ]
    }
  },
  "include": [
    "src"
  ]
}

typedoc.json:

{
  "extends": [
    "../../../typedoc.base.json"
  ],
  "entryPoints": [
    "src/index.ts"
  ]
}

This is the currents status of these files. I build the project successfully and then I run:
npm run docs

I get this output in the terminal:

> typedoc --tsconfig tsconfig.base.json --out docs

[debug] Reading tsconfig at ./tsconfig.base.json
[debug] Using TypeScript 5.3.2 from ./node_modules/typescript/lib
[debug] Expanded ./packages/components/Filter to:
        ./packages/components/Filter/package.json
[debug] Reading project at ./packages/components/Filter
[debug] Reading tsconfig at ./packages/components/Filter/tsconfig.json
[info] Converting project at ./packages/components/Filter
[debug] Using TypeScript 5.3.2 from ./node_modules/typescript/lib     
[debug] Expanded ./packages/components/Filter/src/index.ts to:        
        ./packages/components/Filter/src/index.ts
[debug] Converting with 1 programs 1 entry points
packages/components/Filter/src/index.ts:1:18 - error TS2307: Cannot find module 'components/Base/src/index' or its corresponding type declarations.

1 import Base from 'components/Base/src/index';
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/components/Filter/src/index.ts:2:19 - error TS2307: Cannot find module 'components/Panel/src' or its corresponding type declarations.

2 import Panel from 'components/Panel/src';
                    ~~~~~~~~~~~~~~~~~~~~~~

packages/components/Filter/src/index.ts:3:27 - error TS2307: Cannot find module 'components/FilterElement/src' or its corresponding type declarations.

3 import FilterElement from 'components/FilterElement/src';
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/components/Filter/src/index.ts:4:30 - error TS2307: Cannot find module 'types/index' or its corresponding type declarations.

4 import { FilterConfig } from 'types/index';
                               ~~~~~~~~~~~~~

packages/components/Filter/src/index.ts:5:24 - error TS2307: Cannot find module 'components/CommandBar/src' or its corresponding type declarations.

5 import CommandBar from 'components/CommandBar/src';
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/components/Filter/src/index.ts:94:11 - error TS2353: Object literal may only specify known properties, and 'properties' does not exist in type '{ objectName: string; type: string; orderIndex: number; title: string; parentItem: string; }'.

94           properties: {
             ~~~~~~~~~~

packages/components/Filter/src/index.ts:111:11 - error TS2353: Object literal may only specify known properties, and 'disabled' does not exist in type '{ objectName: string; type: string; orderIndex: number; title: string; parentItem: string; }'.

111           disabled: 'yes',
              ~~~~~~~~

[error] Failed to convert one or more packages, result will not be merged together
[debug] Full run took 4521ms
[error] Found 8 errors and 0 warnings

I suddenly get all of these errors that weren’t there before. I even tried it on another component but I get similar errors. I tried a lot of things, reached out to different people in my team and even to TeamGPT but my efforts were all in vain and i’m out of ideas as to how to solve this problem. So I would greatly appreciate it if you can give me a hand. 🙂

New contributor

Tereza Hristova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật