[BUG] Routing parse issue
See original GitHub issueOverview of the issue
Installed compodoc locally on an old CLI generated Angular project.
After adding the compodoc script in package.json:
npm run compodoc
...
[06:56:54] Get dependencies data
[06:56:55] parsing : /Users/gary/myapp/src/main.ts
[06:56:55] parsing : /Users/gary/myapp/src/polyfills.ts
[06:56:55] parsing : /Users/gary/myapp/src/app/app-routing.module.ts
[06:56:55] Analysing routes definitions and clean them if necessary
Unhandled Rejection at: Promise {
<rejected> Error: Expected to find an initializer.
at InvalidOperationError.BaseError [as constructor] (/Users/gary/myapp/node_modules/ts-simple-ast/dist/errors/BaseError.js:7:28)
at new InvalidOperationError (/Users/gary/myapp/node_modules/ts-simple-ast/dist/errors/InvalidOperationError.js:8:28)
at Object.throwIfNullOrUndefined (/Users/gary/myapp/node_modules/ts-simple-ast/dist/errors/helpers.js:96:15)
at EnumMember.InitializerGetExpressionableNode.class_1.getInitializerOrThrow (/Users/gary/myapp/node_modules/ts-simple-ast/dist/compiler/base/initializer/InitializerGetExpressionableNode.js:25:27)
at RouterParserUtil.cleanFileDynamics (/Users/gary/myapp/node_modules/@compodoc/compodoc/dist/index-cli.js:1383:80)
at Dependencies.getSourceFileDecorators (/Users/gary/myapp/node_modules/@compodoc/compodoc/dist/index-cli.js:5812:45)
at /Users/gary/myapp/node_modules/@compodoc/compodoc/dist/index-cli.js:5638:27
at Array.map (<anonymous>)
at Dependencies.getDependencies (/Users/gary/myapp/node_modules/@compodoc/compodoc/dist/index-cli.js:5632:21)
at CliApplication.Application.getDependenciesData (/Users/gary/myapp/node_modules/@compodoc/compodoc/dist/index-cli.js:7309:40) } reason: Error: Expected to find an initializer.
at InvalidOperationError.BaseError [as constructor] (/Users/gary/myapp/node_modules/ts-simple-ast/dist/errors/BaseError.js:7:28)
at new InvalidOperationError (/Users/gary/myapp/node_modules/ts-simple-ast/dist/errors/InvalidOperationError.js:8:28)
at Object.throwIfNullOrUndefined (/Users/gary/myapp/node_modules/ts-simple-ast/dist/errors/helpers.js:96:15)
at EnumMember.InitializerGetExpressionableNode.class_1.getInitializerOrThrow (/Users/gary/myapp/node_modules/ts-simple-ast/dist/compiler/base/initializer/InitializerGetExpressionableNode.js:25:27)
at RouterParserUtil.cleanFileDynamics (/Users/gary/myapp/node_modules/@compodoc/compodoc/dist/index-cli.js:1383:80)
at Dependencies.getSourceFileDecorators (/Users/gary/myapp/node_modules/@compodoc/compodoc/dist/index-cli.js:5812:45)
at /Users/gary/myapp/node_modules/@compodoc/compodoc/dist/index-cli.js:5638:27
at Array.map (<anonymous>)
at Dependencies.getDependencies (/Users/gary/myapp/node_modules/@compodoc/compodoc/dist/index-cli.js:5632:21)
at CliApplication.Application.getDependenciesData (/Users/gary/myapp/node_modules/@compodoc/compodoc/dist/index-cli.js:7309:40)
Operating System, Node.js, npm, compodoc version(s)
OSX 10.13.3, Node.js 10.0.0, npm 6.0.1, compodoc@1.1.3, AngularCLI 1.6, Angular Core 5.1.1
Angular configuration, a package.json
file in the root folder
Stock standard Angular CLI 1.6 generated project
"dependencies": {
"@angular/animations": "^5.1.1",
"@angular/common": "^5.1.1",
"@angular/compiler": "^5.1.1",
"@angular/core": "^5.1.1",
"@angular/forms": "^5.1.1",
"@angular/http": "^5.1.1",
"@angular/platform-browser": "^5.1.1",
"@angular/platform-browser-dynamic": "^5.1.1",
"@angular/router": "^5.1.1",
"@angular/service-worker": "^5.1.1",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.7",
"bootstrap": "^4.0.0-beta.2",
"core-js": "^2.5.3",
"font-awesome": "^4.7.0",
"moment-timezone": "^0.5.14",
"ng2-img-cropper": "^0.9.0",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.6.0",
"@angular/compiler-cli": "^5.1.1",
"@angular/language-service": "^5.1.1",
"@compodoc/compodoc": "^1.1.3",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/moment-timezone": "^0.5.4",
"@types/node": "^6.0.94",
"codelyzer": "^4.0.2",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"
}
Compodoc installed globally or locally ?
Locally.
Motivation for or Use Case
I wanted to see what compodoc did with a previous project of mine, but I can’t get past this line:
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)
I searched for the bug prior to making this submission, but found nothing.
Reproduce the error
Simply run compodoc
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Global route syntax causes parse error · Issue #246 - GitHub
I ran into this problem while using path-to-regex in my own app, and was able to reproduce ... Global route syntax causes parse...
Read more >React-Router Parsing error: Unexpected token - Stack Overflow
I am trying to use react-redux with an navbar to switch components with react-router but i get this ...
Read more >errorElement v6.6.1 - React Router
You don't have to worry about the rest of the work in the loader (like parsing the user's markdown bio) when it doesn't...
Read more >Router - Angular
A handler for errors thrown by Router.parseUrl(url) when url contains an invalid character. The most common case is a % sign that's not...
Read more >Routing in ASP.NET Core - Microsoft Learn
Routing is responsible for matching incoming HTTP requests and dispatching those requests to the app's executable endpoints.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i am having the same issue, #669 #632 #608 and #603 seem to be related, would be great to have a fix
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.