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

Error: Error parsing file src\main\webapp\app\admin\user-management\user-management.route.ts: SyntaxError: Type expected. #33

Open
naris opened this issue Apr 27, 2021 · 1 comment

Comments

@naris
Copy link

naris commented Apr 27, 2021

Error: Error parsing file src\main\webapp\app\admin\user-management\user-management.route.ts: SyntaxError: Type expected. (12:63)
10 |
11 | @Injectable({ providedIn: 'root' })

12 | export class UserManagementResolve implements Resolve<IUser | > {
| ^
13 |
14 | constructor(private service: UserManagementService) {}
15 |

At: import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot, Routes } from '@angular/router';
import { Observable, of } from 'rxjs';

import { IUser } from './user-management.model';
import { UserManagementService } from './service/user-management.service';
import { UserManagementComponent } from './list/user-management.component';
import { UserManagementDetailComponent } from './detail/user-management-detail.component';
import { UserManagementUpdateComponent } from './update/user-management-update.component';

@Injectable({ providedIn: 'root' })
export class UserManagementResolve implements Resolve<IUser | > {

constructor(private service: UserManagementService) {}

resolve(route: ActivatedRouteSnapshot): Observable<IUser | null> {
    const id = route.params['login'];
    if (id) {
        return this.service.find(id);
    }
return of(null);
}

}

export const userManagementRoute: Routes = [
{
path: '',
component: UserManagementComponent,
data: {
pageTitle: 'Users',
},
},
{
path: ':login/view',
component: UserManagementDetailComponent,
resolve: {
user: UserManagementResolve
}
},
{
path: 'new',
component: UserManagementUpdateComponent,
resolve: {
user: UserManagementResolve
}
},
{
path: ':login/edit',
component: UserManagementUpdateComponent,
resolve: {
user: UserManagementResolve
}
}
];

at npm\node_modules\generator-jhipster\generators\generator-transforms.js:62:20
@naris
Copy link
Author

naris commented Jun 23, 2021

I have since found that this error does not happen if you enable international support and select a 2nd language to support. If you do not enable international support, you get the above error :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant