Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] : --disableCoverage flag causes parse error #786

Closed
gabrielbissey opened this issue May 23, 2019 · 2 comments
Closed

[BUG] : --disableCoverage flag causes parse error #786

gabrielbissey opened this issue May 23, 2019 · 2 comments

Comments

@gabrielbissey
Copy link

Overview of the issue

Generating documentation with the --disableCoverage flag causes a parse error. This is the exact command I'm running: "npx compodoc -p src/tsconfig.app.json --theme readthedocs --includes additional_documentation --includesName 'How to Write Documentation' --disableCoverage". When I remove the --disableCoverage flag and modify nothing else, the documentation is generated just fine.

Stack trace:

Unhandled Rejection at: Promise {
TypeError: Cannot read property 'depth' of undefined
at Object.eval [as main] (eval at createFunctionContext (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:257:23), :8:93)
at main (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/runtime.js:175:32)
at Object.ret (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/runtime.js:178:12)
at Object.ret [as routes] (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:526:21)
at Object.invokePartialWrapper [as invokePartial] (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/runtime.js:72:46)
at eval (eval at createFunctionContext (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:257:23), :5:31)
at Object.prog [as fn] (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/runtime.js:221:12)
at CompareHelper.helperFunc (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/dist/index-cli.js:1759:24)
at Object. (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/dist/index-cli.js:3348:38)
at Object.eval [as main] (eval at createFunctionContext (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:257:23), :52:65) } reason: TypeError: Cannot read property 'depth' of undefined
at Object.eval [as main] (eval at createFunctionContext (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:257:23), :8:93)
at main (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/runtime.js:175:32)
at Object.ret (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/runtime.js:178:12)
at Object.ret [as routes] (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:526:21)
at Object.invokePartialWrapper [as invokePartial] (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/runtime.js:72:46)
at eval (eval at createFunctionContext (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:257:23), :5:31)
at Object.prog [as fn] (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/runtime.js:221:12)
at CompareHelper.helperFunc (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/dist/index-cli.js:1759:24)
at Object. (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/dist/index-cli.js:3348:38)
at Object.eval [as main] (eval at createFunctionContext (/home/vmuser/dev/SpiritGui/node_modules/@compodoc/compodoc/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:257:23), :52:65)

Rest of error:

Sorry, but there was a problem during parsing or generation of the documentation. Please fill an issue on github. (https://github.com/compodoc/compodoc/issues/new)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! spirit-gui@0.0.0 compodoc: npx compodoc -p src/tsconfig.app.json --theme readthedocs --includes additional_documentation --includesName 'How to Write Documentation' --disableCoverage
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the spirit-gui@0.0.0 compodoc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/vmuser/.npm/_logs/2019-05-23T15_13_52_667Z-debug.log

Operating System, Node.js, npm, compodoc version(s)

Operating System: Red Hat Enterprise Linux Server release 6.9 (Santiago)

Node.js: v8.11.3

npm: 6.9.0

compodoc version: ^1.1.9

Angular configuration, a package.json file in the root folder

package.json:

{
"name": "spirit-gui",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.config.json",
"build": "ng build --dev --deploy-url=/",
"prod": "ng build --prod --aot --deploy-url=/",
"test": "ng test --json",
"lint": "ng lint",
"pree2e": "webdriver-manager update --standalone false --gecko false --ignore_ssl",
"e2e": "ng e2e -uw fal",
"compodoc": "npx compodoc -p src/tsconfig.app.json --theme readthedocs --includes additional_documentation --includesName 'How to Write Documentation' --disableCoverage",
"serveWithDocs": "npm run compodoc && npm start"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.0",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.0",
"@ngrx/core": "^1.2.0",
"@ngrx/effects": "^6.1.0",
"@ngrx/schematics": "^6.1.0",
"@ngrx/store": "^6.1.0",
"chart.js": "^2.7.2",
"classlist.js": "^1.1.20150312",
"core-js": "^2.5.4",
"eventsource": "^1.0.7",
"jasmine-marbles": "^0.5.0",
"ng-event-source": "^1.0.13",
"rxjs": "^6.2.2",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-builders/jest": "^1.2.2",
"@angular-devkit/build-angular": "^0.13.8",
"@angular/cli": "~6.1.3",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@compodoc/compodoc": "^1.1.9",
"@ngrx/store-devtools": "^6.1.0",
"@types/chart.js": "^2.7.31",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~10.9.1",
"codelyzer": "~4.4.4",
"jasmine-marbles": "^0.5.0",
"jasmine-core": "~3.2.1",
"jasmine-spec-reporter": "~4.2.1",
"jest": "^23.6.0",
"jest-canvas-mock": "^1.1.0",
"protractor": "^5.4.0",
"ts-node": "~7.0.1",
"tslint": "~5.11.0",
"typescript": "^2.9.2"
}
}

Compodoc installed globally or locally ?

Globally

If possible sourcecode of the file where it breaks

No source code

If possible your terminal logs before the error

0 info it worked if it ends with ok
1 verbose cli [ '/opt/node-v8.11.3-linux-x64/bin/node',
1 verbose cli '/opt/node-v8.11.3-linux-x64/bin/npm',
1 verbose cli 'run',
1 verbose cli 'compodoc' ]
2 info using npm@6.9.0
3 info using node@v8.11.3
4 verbose run-script [ 'precompodoc', 'compodoc', 'postcompodoc' ]
5 info lifecycle spirit-gui@0.0.0precompodoc: spirit-gui@0.0.0
6 info lifecycle spirit-gui@0.0.0
compodoc: spirit-gui@0.0.0
7 verbose lifecycle spirit-gui@0.0.0compodoc: unsafe-perm in lifecycle true
8 verbose lifecycle spirit-gui@0.0.0
compodoc: PATH: /opt/node-v8.11.3-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/vmuser/dev/SpiritGui/node_modules/.bin:/opt/apache-maven-3.3.9/bin:/opt/node-v8.11.3-linux-x64/bin:/opt/apache-activemq-5.13.3/bin:/opt/PostgreSQL/9.6/bin:/usr/java/jdk1.8.0_181-amd64/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/vmuser/bin
9 verbose lifecycle spirit-gui@0.0.0compodoc: CWD: /home/vmuser/dev/SpiritGui
10 silly lifecycle spirit-gui@0.0.0
compodoc: Args: [ '-c',
10 silly lifecycle 'npx compodoc -p src/tsconfig.app.json --theme readthedocs --includes additional_documentation --includesName 'How to Write Documentation' --disableCoverage' ]
11 silly lifecycle spirit-gui@0.0.0compodoc: Returned: code: 1 signal: null
12 info lifecycle spirit-gui@0.0.0
compodoc: Failed to exec compodoc script
13 verbose stack Error: spirit-gui@0.0.0 compodoc: npx compodoc -p src/tsconfig.app.json --theme readthedocs --includes additional_documentation --includesName 'How to Write Documentation' --disableCoverage
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/opt/node-v8.11.3-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess. (/opt/node-v8.11.3-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid spirit-gui@0.0.0
15 verbose cwd /home/vmuser/dev/SpiritGui
16 verbose Linux 2.6.32-754.el6.x86_64
17 verbose argv "/opt/node-v8.11.3-linux-x64/bin/node" "/opt/node-v8.11.3-linux-x64/bin/npm" "run" "compodoc"
18 verbose node v8.11.3
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error spirit-gui@0.0.0 compodoc: npx compodoc -p src/tsconfig.app.json --theme readthedocs --includes additional_documentation --includesName 'How to Write Documentation' --disableCoverage
22 error Exit status 1
23 error Failed at the spirit-gui@0.0.0 compodoc script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Motivation for or Use Case

We are trying to disable coverage because there are a lot of files that we don't want coverage for becasue they are dumb components/ NgRX, which we feel are unnecessary to document. Leaving them in the coverage drags down our code coverage percentage.

Reproduce the error

pakage.json:

{
"scripts": {
"compodoc": "npx compodoc -p src/tsconfig.app.json --theme readthedocs --includes additional_documentation --includesName 'How to Write Documentation' --disableCoverage"
}
}

  • command used: "npm run compodoc"
@vogloblinsky vogloblinsky changed the title BUG: --disableCoverage flag causes parse error [BUG] : --disableCoverage flag causes parse error Jun 11, 2019
@vogloblinsky
Copy link
Contributor

Reproduced

@lock
Copy link

lock bot commented Sep 30, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. Why locking ? Having issues with the most up-to-date context.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants