TypeDoc is displaying the following error:
Error: Option 'sourceRoot can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.
The CLI command I'm using to execute TypeDoc is
typedoc --out ./typedoc-output ./
My TypeScript project contains a tsconfig.json file in the root of the project containing the following:
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"sourceMap": true,
"declaration": true,
"strictNullChecks": true,
"sourceRoot": "./"
},
I'm confused about the status of this
also, is typedoc just broken? how do i get around this?
As a workaround I have added 'sourceMap: true"
this.compilerOptions = {
target: ts.ScriptTarget.ES3,
module: ts.ModuleKind.None,
sourceMap: true,
};
in file node_modules/typedoc/dist/lib/utils/options/options.js
What is the status of this bug?
I can reproduce this on 0.9.0 and can fix it with @dmdm's suggestion
But obviously this is not ideal
The workaround is not acceptable. The bug is happening to me too. Using TypeDoc version 0.10.0
I find that if I pass --ignoreCompilerErrors then it ignores this compiler error. But I'm not sure what other implications there might be, other than other compiler errors may be important not to ignore.
This bug still is present using TypeDoc 0.11.1 running on TypeScript 2.7.2 having this configuration inside my tsconfig.json:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "dist",
"module": "esnext",
"target": "es5",
"lib": ["es2017", "dom"],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"allowSyntheticDefaultImports": true,
"sourceRoot": "src"
},
"exclude": [
"node_modules",
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest",
"src/setupTests.ts"
]
}
Executing with the --ignoreCompilerErrors argument (by just calling typedoc --out .\doc --ignoreCompilerErrors) created some output, but still prompted that warning-essage.
Is this bug anything important? Can this be ignored safely?
Most helpful comment
The workaround is not acceptable. The bug is happening to me too. Using TypeDoc version 0.10.0