-
-
Notifications
You must be signed in to change notification settings - Fork 745
Closed
Milestone
Description
Search terms
typedoc.config.js typedoc.config.mjs ECMAScript modules
Expected Behavior
The existing ESM typedoc configuration still functions correctly with Node v23.0.0
Actual Behavior
Following error is raised, when running typedoc:
[error] Unknown option '__esModule' You may have meant:
out
json
theme
readme
sort
help
locales
exclude
emit
name
version
[error] Unknown option 'default' You may have meant:
out
emit
help
defaultCategory
watch
Steps to reproduce the bug
Prerequisite:
- use a ESM typescript configuration, e.g.:
/** @type {Partial<import('typedoc').TypeDocOptions>} */ const config = { entryPoints: ["./src/index.ts", "./src/secondary-entry.ts"], out: "doc", }; export default config;
- use node v23.0.0
- package.json requirements, mentioned in the node docs1
When running typedoc, the above-mentioned error is raised, because following statement returns an object { __esModule: true, default: { /* typedoc config */ } }
1:
fileContent = await require(file); |
Following Workaround can be used to avoid the issue:
/** @type {Partial<import('typedoc').TypeDocOptions>} */
const config = {
entryPoints: ["./src/index.ts", "./src/secondary-entry.ts"],
out: "doc",
};
export default config;
export { config as 'module.exports' } // dummy CommonJS export
Environment
- Typedoc version: 0.26.8
- TypeScript version: 5.6.3
- Node.js version: 23.0.0
- OS: Ubuntu 22.04
Footnotes
khelkunpeterhirn