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] Problem to parse data in routing parameters #417

Closed
ZioGene opened this issue Dec 22, 2017 · 1 comment
Closed

[BUG] Problem to parse data in routing parameters #417

ZioGene opened this issue Dec 22, 2017 · 1 comment

Comments

@ZioGene
Copy link

ZioGene commented Dec 22, 2017

Overview of the issue

Since I never add static const in data routing all work fine, with array of const compodoc is not working.

const ROOT_ROUTES: Routes = [
    {
        path: '',
        component: RootComponent,
        canActivate: [AuthGuard],
        children: [
            {path: '', redirectTo: 'homepage', pathMatch: 'full'},
            {
                path: 'homepage', loadChildren: 'app/homepage/homepage.module#HomepageModule'
            },
            {
                path: 'pratica', loadChildren: 'app/pratica/pratica.module#PraticaModule',
                data: {preload: true, preloadCapabilities: [ApplicationParams.capabilities.NFE_ABIL_SIMULAZIONE]}
            },
            {
                path: 'accesso-rapido', loadChildren: 'app/accesso-rapido/accesso-rapido.module#AccessoRapidoModule',
                data: {preload: true}
            },
            {
                path: 'attivita-sospese',
                loadChildren: 'app/attivita-sospese/attivita-sospese.module#AttivitaSospeseModule',
                data: {preload: true, preloadCapabilities: [ApplicationParams.capabilities.CMS_AUTHOR]}
            },
            {
                path: 'parametrizzazioni',
                loadChildren: 'app/parametrizzazioni/parametrizzazioni.module#ParametrizzazioniModule'
            }

        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(ROOT_ROUTES)],
    exports: [RouterModule]
})
export class RootRoutingModule {
}

Here is the stacktrace:
Unhandled Rejection at: Promise {
{ SyntaxError: Expected ']' instead of '.' at line 1 column 359 of the JSON5 data. Still to read: "."capabilities"."NFE"
at error (C:\Users\g.zappulla\WebstormProjects\NFE\node_modules\json5\lib\json5.js:56:25)
at next (C:\Users\g.zappulla\WebstormProjects\NFE\node_modules\json5\lib\json5.js:72:17)
at array (C:\Users\g.zappulla\WebstormProjects\NFE\node_modules\json5\lib\json5.js:423:25)
at value (C:\Users\g.zappulla\WebstormProjects\NFE\node_modules\json5\lib\json5.js:484:20)
at object (C:\Users\g.zappulla\WebstormProjects\NFE\node_modules\json5\lib\json5.js:459:35)
at value (C:\Users\g.zappulla\WebstormProjects\NFE\node_modules\json5\lib\json5.js:482:20)
at object (C:\Users\g.zappulla\WebstormProjects\NFE\node_modules\json5\lib\json5.js:459:35)
at value (C:\Users\g.zappulla\WebstormProjects\NFE\node_modules\json5\lib\json5.js:482:20)
at array (C:\Users\g.zappulla\WebstormProjects\NFE\node_modules\json5\lib\json5.js:417:36)
at value (C:\Users\g.zappulla\WebstormProjects\NFE\node_modules\json5\lib\json5.js:484:20)
message: 'Expected ']' instead of '.' at line 1 column 359 of the JSON5 data. Still to read: ".\"capabilities\".\"NFE"',
at: 358,
lineNumber: 1,

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

OS: Windows10
Node 6.11.3
NPM 3.10.10
compodoc 1.0.5

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

{
"name": "test",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod -e",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"compodoc": "compodoc -p src/tsconfig.app.json -s"
},
"private": true,
"dependencies": {
"@angular/common": "=4.0.0",
"@angular/compiler": "=4.0.0",
"@angular/core": "=4.0.0",
"@angular/forms": "=4.0.0",
"@angular/http": "=4.0.0",
"@angular/platform-browser": "=4.0.0",
"@angular/platform-browser-dynamic": "=4.0.0",
"@angular/router": "=4.0.0",
"@ngx-translate/core": "^7.0.0",
"@ngx-translate/http-loader": "^0.1.0",
"angular2-materialize": "=15.0.4",
"blueimp-canvas-to-blob": "^3.14.0",
"classlist.js": "=1.1.20150312",
"core-js": "=2.4.1",
"intl": "=1.2.5",
"materialize-css": "=0.99.0",
"moment": "^2.18.1",
"mydatepicker": "=1.8.3",
"ng2-img-cropper": "^0.9.0",
"rxjs": "^5.1.0",
"web-animations-js": "=2.2.5",
"zone.js": "=0.8.4"
},
"devDependencies": {
"@angular/cli": "=1.4.3",
"@angular/compiler-cli": "=4.0.0",
"@compodoc/compodoc": "=1.0.5",
"@ngui/auto-complete": "=0.13.3",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"grunt": "^1.0.1",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-war": "^0.5.1",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "=0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "=0.2.2",
"load-grunt-tasks": "^3.5.2",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}

Compodoc installed globally or locally ?

local and global

Suggest a Fix

Maybe you have to fix the parse json

@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