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] Could not generate doc with typed Object as 'data' in Angular Routes #661

Open
lutzvahl opened this issue Sep 25, 2018 · 5 comments
Open

Comments

@lutzvahl
Copy link

Overview of the issue
Operating System, Node.js, npm, compodoc version(s)
Angular configuration, a package.json file in the root folder

"dependencies": {
"@angular/common": "^6.1.6",
"@angular/compiler": "^6.1.6",
"@angular/core": "^6.1.6",
"@angular/forms": "^6.1.6",
"@angular/http": "^6.1.6",
"@angular/platform-browser": "^6.1.6",
"@angular/platform-browser-dynamic": "^6.1.6",
"@angular/router": "^6.1.6",
"@ng-bootstrap/ng-bootstrap": "^3.2.0",
"core-js": "^2.5.7",
"fingerprintjs2": "^1.8.1",
"font-awesome": "^4.7.0",
"linqts": "^1.12.0",
"moment": "^2.22.2",
"ng2-charts": "^1.6.0",
"ngx-bootstrap": "^3.0.1",
"object-assign": "^4.1.1",
"rxjs": "^6.3.1",
"stacktrace-js": "^2.0.0",
"typescript": "^2.9.2",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^2.3.0",
"@angular-devkit/architect": "^0.7.5",
"@angular-devkit/build-angular": "^0.7.5",
"@angular-devkit/core": "^0.7.5",
"@angular/cli": "^6.1.5",
"@angular/compiler-cli": "^6.1.6",
"@compodoc/compodoc": "^1.1.5",
"@types/angular": "^1.5.16",
"@types/angular-resource": "^1.5.6",
"@types/angular-route": "^1.3.2",
"@types/angular-sanitize": "^1.3.3",
"@types/hammerjs": "^2.0.35",
"@types/uglify-js": "^2.6.28",
"codelyzer": "^4.4.4",
"intl": "^1.2.5",
"less": "^2.7.2",
"ts-node": "^3.0.2",
"tslib": "^1.9.3",
"tslint": "^5.11.0",
"typedoc": "^0.12.0",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-sources": "^1.2.0"
},
"engines": {
"node": ">= 8",
"npm": ">= 5"
}

Compodoc installed globally or locally ?

locally

If possible sourcecode of the file where it breaks

const routes: Routes = [
{
path: "", component: MyComp, children: [
{ path: 'details/:id', redirectTo: '/details/:id/DETAILS', pathMatch: 'full' },
{
path: "details/:id/:detailsSection", loadChildren: "../lazy/xx-yy-details.module#DetailsModule"
, data: new LazyRoutingOptions({ preload: true, delay: 2500 })
}
]
}
];

With the following code the generation is working:

const routes: Routes = [
{
path: "", component: MyComp, children: [
{ path: 'details/:id', redirectTo: '/details/:id/DETAILS', pathMatch: 'full' },
{
path: "details/:id/:detailsSection", loadChildren: "../lazy/xx-yy-details.module#DetailsModule"
, data: { preload: true, delay: 2500 }
}
]
}
];

If possible your terminal logs before the error

Unhandled Rejection at: Promise {
{ SyntaxError: JSON5: invalid character '(' at 1:285
at syntaxError (C:\XXX\node_modules@compodoc\compodoc\node_modules\json5\lib\parse.js:1083:17)
at invalidChar (C:\XXX\node_modules@compodoc\compodoc\node_modules\json5\lib\parse.js:1028:12)
at Object.afterPropertyValue (C:\XXX\node_modules@compodoc\compodoc\node_modules\json5\lib\parse.js:654:15)
at Object.default (C:\XXX\node_modules@compodoc\compodoc\node_modules\json5\lib\parse.js:146:37)
at lex (C:\XXX\node_modules@compodoc\compodoc\node_modules\json5\lib\parse.js:78:42)
at Object.parse (C:\XXX\node_modules@compodoc\compodoc\node_modules\json5\lib\parse.js:25:17)
at loopInsideModule (C:\XXX\node_modules@compodoc\compodoc\dist\index-cli.js:1073:52)
at loopRoutesParser (C:\XXX\node_modules@compodoc\compodoc\dist\index-cli.js:1106:29)
at loopRoutesParser (C:\XXX\node_modules@compodoc\compodoc\dist\index-cli.js:1111:21)
at RouterParserUtil.constructRoutesTree (C:\XXX\node_modules@compodoc\compodoc\dist\index-cli.js:1115:9) lineNumber: 1, columnNumber: 285 } } reason: { SyntaxError: JSON5: invalid character '(' at 1:285
at syntaxError (C:\XXX\node_modules@compodoc\compodoc\node_modules\json5\lib\parse.js:1083:17)
at invalidChar (C:\XXX\node_modules@compodoc\compodoc\node_modules\json5\lib\parse.js:1028:12)
at Object.afterPropertyValue (C:\XXX\node_modules@compodoc\compodoc\node_modules\json5\lib\parse.js:654:15)
at Object.default (C:\XXX\node_modules@compodoc\compodoc\node_modules\json5\lib\parse.js:146:37)
at lex (C:\XXX\node_modules@compodoc\compodoc\node_modules\json5\lib\parse.js:78:42)
at Object.parse (C:\XXX\node_modules@compodoc\compodoc\node_modules\json5\lib\parse.js:25:17)
at loopInsideModule (C:\XXX\node_modules@compodoc\compodoc\dist\index-cli.js:1073:52)
at loopRoutesParser (C:\XXX\node_modules@compodoc\compodoc\dist\index-cli.js:1106:29)
at loopRoutesParser (C:\XXX\node_modules@compodoc\compodoc\dist\index-cli.js:1111:21)
at RouterParserUtil.constructRoutesTree (C:\XXX\node_modules@compodoc\compodoc\dist\index-cli.js:1115:9) lineNumber: 1, columnNumber: 285 }
[13:30:46] 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

Motivation for or Use Case

Type security of lazy loading options

Related issues

#404 and Routing Issues https://github.com/compodoc/compodoc/projects/3

Suggest a Fix
@bartios
Copy link

bartios commented Sep 27, 2018

looks like something related to #525 to me

@vogloblinsky vogloblinsky added this to the 1.1.7 milestone Oct 10, 2018
Arinono added a commit to UReflect/web that referenced this issue Oct 29, 2018
Trying to comply with compodoc which contains several issues reported about usage of objects in
routes defenitions. See compodoc/compodoc#680 or
compodoc/compodoc#661 and many others
(https://github.com/compodoc/compodoc/projects/3)
@vogloblinsky vogloblinsky modified the milestones: 1.1.7, 1.1.9 Jan 29, 2019
@vogloblinsky vogloblinsky modified the milestones: 1.1.9, 1.3.0 Feb 23, 2019
@thatsmeta
Copy link

Please fix this...

@stale
Copy link

stale bot commented Sep 30, 2019

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 stale bot added the wontfix label Sep 30, 2019
@stale
Copy link

stale bot commented Oct 7, 2019

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.

@stale stale bot closed this as completed Oct 7, 2019
@lock
Copy link

lock bot commented Dec 6, 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 Dec 6, 2019
@vogloblinsky vogloblinsky reopened this Jul 15, 2021
@stale stale bot removed the wontfix label Jul 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Routing issues
Awaiting triage
Development

No branches or pull requests

4 participants