compodoc / compodoc

:notebook_with_decorative_cover: The missing documentation tool for your Angular, Nest & Stencil application
https://compodoc.app
MIT License
4k stars 401 forks source link

[BUG] Maximum call stack size exceeded #724

Closed zambov closed 5 years ago

zambov commented 5 years ago
Overview of the issue

Random error: Maximum call stack size exceeded

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

OS: Linux: debian 9 Node: v8.9.0 npm: 5.5.1 compodoc: 1.1.7

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

{ "name": "newplan-frontend", "version": "0.0.0", "license": "MIT", "husky": { "hooks": { "pre-commit": "npm run lint && npm run test:ci" } }, "scripts": {

// SOME OTHER SCRIPTS "doc": "./node_modules/.bin/compodoc -p src/tsconfig.app.json --disableSearch -n 'Newplan Frontend' --serve --open", "doc:watch": "./node_modules/.bin/compodoc -p src/tsconfig.app.json --disableSearch -w", "doc:silent": "./node_modules/.bin/compodoc -p src/tsconfig.app.json --disableSearch -n 'Newplan }, "private": true, "dependencies": { "@angular/animations": "^6.1.10", "@angular/common": "^6.1.10", "@angular/compiler": "^6.1.10", "@angular/core": "^6.1.10", "@angular/elements": "^6.1.10", "@angular/forms": "^6.1.10", "@angular/http": "^6.1.10", "@angular/platform-browser": "^6.1.10", "@angular/platform-browser-dynamic": "^6.1.10", "@angular/router": "^6.1.10", "@asymmetrik/ngx-leaflet": "^4.0.0", "@asymmetrik/ngx-leaflet-draw": "^3.2.0", "@ngrx/effects": "^6.1.2", "@ngrx/router-store": "^6.1.2", "@ngrx/store": "^6.1.2", "@ngrx/store-devtools": "^6.1.2", "@ngx-translate/core": "^11.0.1", "@ngx-translate/http-loader": "^4.0.0", "@siag/js-egov-authentication": "file:~/Downloads/js-egov-authentication-3.1.6.tgz", "@siag/jsui-egov-authentication": "file:~/Downloads/jsui-egov-authentication-3.1.6.tgz", "@siag/ng1-egov-authentication": "file:~/Downloads/ng1-egov-authentication-3.1.6.tgz", "ag-grid-angular": "^20.0.0", "ag-grid-community": "^20.0.0", "bootstrap": "^4.2.1", "core-js": "^2.6.3", "flag-icon-css": "^3.2.1", "font-awesome": "^4.7.0", "jasmine-marbles": "^0.4.1", "jquery": "^3.3.1", "leaflet": "^1.4.0", "leaflet-draw": "^1.0.4", "leaflet.fullscreen": "^1.4.5", "lodash": "^4.17.11", "moment": "^2.24.0", "ngrx-store-localstorage": "^7.0.0", "ngx-moment": "^3.3.0", "popper.js": "^1.14.6", "rxjs": "6.3.3", "zone.js": "^0.8.29" }, "devDependencies": { "@angular-devkit/build-angular": "~0.6.8", "@angular/cli": "~6.0.7", "@angular/compiler-cli": "^6.1.10", "@angular/language-service": "^6.1.10", "@compodoc/compodoc": "^1.1.7", "@types/jasmine": "^2.8.15", "@types/jasminewd2": "^2.0.6", "@types/leaflet": "^1.4.0", "@types/leaflet-draw": "^0.4.13", "@types/lodash": "^4.14.120", "@types/node": "^6.0.118", "codelyzer": "^4.5.0", "concat": "^1.0.3", "fs-extra": "^6.0.1", "http-server": "^0.11.1", "husky": "^1.3.1", "jasmine-core": "~2.8.0", "jasmine-spec-reporter": "~4.2.1", "jest": "^23.6.0", "jest-preset-angular": "^6.0.2", "jshint": "^2.9.7", "json-server": "^0.14.2", "ngrx-store-freeze": "^0.2.4", "ngx-logger": "^3.3.9", "protractor": "~5.1.2", "ts-node": "~4.1.0", "tslint": "~5.9.1", "typescript": "~2.7.2" } }

Compodoc installed globally or locally ?

Installed locally

If possible sourcecode of the file where it breaks

noode_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:10271:46

If possible your terminal logs before the error

Unhandled Rejection at: Promise {

RangeError: Maximum call stack size exceeded at Object.getSpecialPropertyAssignmentKind (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:10271:46) at bindWorker (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:23651:42) at bind (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:23560:13) at visitNode (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:14777:24) at Object.forEachChild (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:14990:24) at bindEachChild (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:22352:16) at bindBinaryExpressionFlow (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:22988:17) at bindChildrenWorker (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:22406:21) at bindChildren (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:22322:17) at bind (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:23571:21) } reason: RangeError: Maximum call stack size exceeded at Object.getSpecialPropertyAssignmentKind (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:10271:46) at bindWorker (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:23651:42) at bind (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:23560:13) at visitNode (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:14777:24) at Object.forEachChild (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:14990:24) at bindEachChild (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:22352:16) at bindBinaryExpressionFlow (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:22988:17) at bindChildrenWorker (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:22406:21) at bindChildren (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:22322:17) at bind (/home/hume02/Progetti/newplan-portal-frontend/portal/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:23571:21) ##### **Motivation for or Use Case** Randomly throw this error. ##### **Reproduce the error** It has not a flow to reproduce it. ##### **Suggest a Fix** Is could be related with barrels?
zambov commented 5 years ago

Ok, after some struggling I found a partial solution, (sometimes it work sometimes not)

When using a file (model mostly) inside a folder with the same name, the maximum call stack error would trigger. By using an index.ts file which exports all the files and specifically pointing to this index instead of the folder, the build succeeds.

Example:

src | -- lib       | -- something             | -- something.ts             | -- index.ts       | -- somethingelse             | -- somethingelse.ts             | -- index.ts

something/index.ts

export * from './something';

public_api.ts (old):

export * from './lib/something';

public_api.ts (new):

export * from './lib/something/index';

For every other import which imported a model with the same name as the folder from an index directly to the folder, you need to specifically call the filename of the model.

somethingelse.ts (old):

import { Something } from './../something';

somethingelse.ts (new):

import { Something } from './../something/something';
vogloblinsky commented 5 years ago

@zambov cannot reproduce with last version...

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been automatically closed because it has not had recent activity. Please file a new issue if you are encountering a similar or related problem. Thank you for your contributions.

lock[bot] commented 4 years ago

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.