Solvedtypedoc typedoc.js Stops Working after Writing Configuration in tsconfig.js is Supported.

I recently started to use typedoc for my new project. But when trying to config the tool via typedoc.js, I can't find good example of how this file should be defined. After some research in the source code, PRs and Issues. It looks like the typedoc.js doesn't support simple exported json object well (It won't understand most of the options listed in the README.md), though an exported function in the file will receive the tool instance. However, in the tsconfig.json, I can define all exposed config options in a typedocOptions property. It looks like the tsconfig.json can be used to replace typedoc.js, if calling the tool instance in an exported function is not that much important to most users.

21 Answers

✔️Accepted Answer

@Laroosta I didn't read @ZheyangSong issue in the detail but you can add your json in a typedocOptions key of your tsconfig.json

In my case

{
  "compilerOptions": {
     //...
  },
  "typedocOptions": {
    "mode": "modules",
    "out": "docs",
    "exclude": "test",
    "theme": "default",
    "ignoreCompilerErrors": true,
    "excludePrivate": true,
    "excludeNotExported": true,
    "target": "ES5",
    "moduleResolution": "node",
    "preserveConstEnums": true,
    "stripInternal": true,
    "suppressExcessPropertyErrors": true,
    "suppressImplicitAnyIndexErrors": true,
    "module": "commonjs"
  }
}

Your command become

typedoc index.ts

I'm not a big fan of it as tsconfig is used by a lot of third party libraries for their config and often not very well documented... But it works for me.

Other Answers:

I'm in favor of fixing typedoc.json support and dropping typedoc.js support. If people need dynamic control of typedoc, they can require the application directly.

Related Issues:

11
typedoc typedoc.js Stops Working after Writing Configuration in tsconfig.js is Supported.
@Laroosta I didn't read @ZheyangSong issue in the detail but you can add your json in a typedocOptio...
3
typedoc Support for ignoreCompilerErrors
I cannot make my mono repo (with ./apps and ./libs) work with multiple tsconfig.json I will be stuck...
3
typedoc Generating class diagrams
I just wanted to update this thread Both the typedoc-plantuml and typedoc-plantuml-extended packages...
175
storybook Webpack 4 support?
I'm getting the below error when running Storybook with a project using Webpack 4; This is preventin...
137
electron vue this.$store.dispatch('someAsyncTask'), action not run
Same here and I've wasted just 2h debugging this crap until I realized the issue is in fact in elect...
124
react styleguidist Support for the experimental syntax 'dynamicImport' isn't currently enabled
For what it's worth Current behavior To reproduce Demo is not based on template but I guess this doe...
121
reactjs.org how to change the state of parent component from child Component if parent state is maintained using useStateHook
Hi! There's no difference in this scenario between function and class components In both cases you w...
111
storybook babelHelpers is not defined using Rollup [Solved]
@alejandronanez you can remove external-helpers from your .babelrc file and enable it back only on y...
111
zeal Content rendering error in MDN (HTML, JS, CSS) docsets
I find it can fix temporary by remove the CSS.docset\Contents\Resources\Documents\developer.mozilla....
79
storybook Storybook doesn't work with the newest version 10.0.1 of PostCSS Autoprefixer plugin
I also get the same issue as @matamatanot (also with tailwind 2.0.2) I might have missed something f...
65
storybook Storybook build fails in Node 13 (cannot find module @babel/compat-data/corejs3-shipped-proposals)
Removing node_modules and yarn.lock and using node 13.13 has been helped for me. ...
65
storybook Storybook 5.0.0 emotion-themeing and React loader bug
Worked for us to add @storybook/theming as an explicit dependency Describe the bug When starting up ...
62
storybook [Angular] How to render a component that has <ng-content> in the template
That couldn't be the solution Why I should write the HTML manually again? It already in the componen...
62
storybook build-storybook doesn't respect tsconfig.json baseUrl config (Module not found: Error: Can't resolve 'components')
@jwm0 your solution worked for me Here's my main.js for reference: Bug or support request summary I'...
60
storybook TypeError: Cannot read property 'createSnapshot' of undefined
@shilman @jimmyandrade @ckwong90 For this issue in particular When I start storybook I got TypeError...
59
storybook Doc code preview "No display name"
What happens if you use {Story()} instead of <Story />? Describe the bug The Doc code preview does n...
57
storybook Feature: custom proxy settings
@ndelangen just when I saw your message I was able to find a solution to my problem using the awesom...
57
storybook TS1086: An accessor cannot be declared in an ambient context
Try skipLibCheck: true inside tsconfig.json eg Hope it will help you !! Describe the bug Upgraded to...
54
storybook Webpack Building Constantly
Having the same issue after upgrading to 6.2.1 Changing my main.js file to only load stories from th...
53
storybook Cant add aliases in storybook config
I think the problem may be trailing slashes Try using ~ and ../src/ exactly It seems to work for me ...
51
storybook TypeError: Cannot read property 'module' of undefined
Logging the three variables in the line (baseConfig env config) => { shows that the latter two are u...
51
storybook Error: Invariant failed: You should not use <Link> outside a <Router>
This is not an issue with storybook the error comes from react-router as is evidenced by the screens...
49
storybook Async/Await
I'm using a vanilla setup of StoryBook with no tweaks to babel ...
49
storybook Storysource is giving me linting errors
I ran into this same Import in body of module; reorder to top import/first error in SB 5.0.x ...
47
storybook Storybook is not able to resolve path with Next js absolute import
Its because thats not an absolute import from root your path is using an alias Describe the bug Stor...
46
compodoc [BUG] Angular 9.0.5 compodoc not considering module and its component
After switching from -p tsconfig.app.json to -p tsconfig.json it worked We have both files ...
40
storybook [webpack5] DefinePlugin cannot read property 'get' of undefined
If someone is still looking around for a solution Describe the bug I cannot build storybook using we...
40
storybook Uncaught Error: Target container is not a DOM element.
If there is someone who hasn't fix the problem jet check the order of your tag elements in html ...
39
L5 Swagger oauth2 + passport = Bearer <token>
Sharing my solution in case it might help This is I how made it to work with Passport using password...
37
storybook Story source code shows "MDXCreateElement" instead of actual source code
It seems to only occur when using an intermediate variable (including the template/bind pattern): ☝️...
37
webpack.js.org Old documentations (3.8)
for other who try to get v3 documentation running locally instruction are: note should be start not ...
36
storybook CSS modules
For webpack 2 I'm using this in .storybook/webpack.config.js and it's working fine: ...
35
storybook Error: exports is not defined
I'm getting this error without using TypeScript just vanilla JS I'm trying to use storybook for the ...
34
storybook [question] How to order top-level sections?
In the same boat as everyone else just sharing because it was such a headache. We've just upgraded t...
34
storybook Knobs not working with v5.2.0-beta.30
I am pretty sure it was caused by the wrong import: instead of Describe the bug When enabling the Kn...
33
mkdocs material Error: Unrecognised theme 'material'
SOLVED! @JerryC8080 thank you so much for your help I had at some point installed mkdocs via Homebre...
33
storybook [Bug] "Invalid hook call" error after upgrading to Storybook 6
It's caused by multiple versions of React being loaded - @storybook/ui most likely contains its own ...
31
storybook Sorting stories
For reference here's the recommended setup for v5.2 onwards: This will sort your story kinds (files)...
30
storybook "Singleton client API not yet initialized"
The solution for vite builder — force dedupe (see https://github.com/eirslett/storybook-builder-vite...
30
storybook Can't get props for addon-info when using decorator (higher order component) on my component
Here is a workaround I used in my project And now my story will look like Hello I wanted to use addo...
29
storybook Getting 404 Registry returned when trying to run `npm install`
Yea I was using sinopia Doing a npm set registry https://registry.npmjs.org/ solved the problem. ...
29
storybook Decorator Children Displayed In Story Source
Place withInfo decorator before other decorator works for me. Describe the bug If a decorator itself...
29
storybook A working example with PostCSS for Storybook v5
Ok for those playing along at home this works perfectly. Is your feature request related to a proble...
28
BookStack Permission denied ".../storage/logs/laravel.log could not be opened"
chmod -R 777 storage worked for me Project Maintainer Edit - For Laravel Developers Gaining an under...
28
storybook Cannot assign to read only property 'exports' of object '#<Object>'
For anyone stumbling across this I faced the same problem after importing a NPM package to a Vue com...
27
webpack.js.org API - Document When a Plugin Should Call `doResolve()`
Hi all -- I'm someone who has also been spelunking through a lot of Webpack's code Specifically Webp...
26
docz v1.0.0-rc.* Compiled with errors: Module parse failed: Unexpected token
Also instead of installing webpack@4.28.2 you can specify it in resolutions in package.json ...
26
storybook babel-loader devDependency causes error in Create-React-App
Hello @ajrussellaudio thanks for your work Unfortunately Describe the bug Installing Storybook in a ...
25
electron vue Milestone Minimize, Project Update
🎉 It's Here! 🎉 Milestone Minimize is officially in the master branch of this repo and can be used ...
24
docz Uncaught TypeError: Cannot read property 'close' of undefined
I've noticed that the problem appears when using docz with react-scripts and the reason is a differe...