Base solution for your next web application
Open Closed

Cannot start client after create entity using power tool (VS2019) #10725


User avatar
0
[email protected] created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? v10.5.0
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .net core

If issue related with ABP Framework

  • What is ABP Framework version?

If issue is about UI

  • Which theme are you using?
  • What are the theme settings?

I try power tool as addon in VS2019. I followed the instruction: ASP.NET Zero Introduction and Features (https://www.youtube.com/watch?v=OsSdNkwmC7I&t=1001s).

After generating entity "QReservationses", I ran nswag/refresh.bat and found both "shared/service-proxies/service-proxies.ts" and "service-proxies.module.ts" was updated with service.

As the document (https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Infrastructure-Angular-NSwag), it asks to manually add for "service-proxies.module.ts". Please help me to clarify this point.

Server is started correctly. But it encountered error while starting client with command "npm start":

./src/app/shared/layout/nav/app-navigation.service.ts:7:0 - Error: Module parse failed: Unexpected token (7:0) File was processed with these loaders:

  • ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js
  • ./node_modules/@ngtools/webpack/src/ivy/index.js You may need an additional loader to handle the result of these loaders. | import * as i2 from "@shared/common/session/app-session.service"; | new AppMenuItem('QReservationses', 'Pages.QReservationses', 'flaticon-more', '/app/main/dbo/qReservationses'),

; | export class AppNavigationService { | constructor(_permissionCheckerService, _appSessionService) {

Error: src/app/shared/layout/nav/app-navigation.service.ts:3:13 - error TS1109: Expression expected.

3 import { PermissionCheckerService } from 'abp-ng2-module'; ~~~~~~

** Angular Live Development Server is listening on 0.0.0.0:4200, open your browser on http://localhost:4200/ **

√ Browser application bundle generation complete.

1740 unchanged chunks

Build at: 2021-12-02T02:24:32.587Z - Hash: ff3031625fde1fa5b5dc - Time: 4000ms

./src/app/shared/layout/nav/app-navigation.service.ts:7:0 - Error: Module parse failed: Unexpected token (7:0) File was processed with these loaders:

  • ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js
  • ./node_modules/@ngtools/webpack/src/ivy/index.js You may need an additional loader to handle the result of these loaders. | import * as i2 from "@shared/common/session/app-session.service"; | new AppMenuItem('QReservationses', 'Pages.QReservationses', 'flaticon-more', '/app/main/dbo/qReservationses'),

; | export class AppNavigationService { | constructor(_permissionCheckerService, _appSessionService) {

Error: src/app/shared/layout/nav/app-navigation.service.ts:3:13 - error TS1109: Expression expected.

3 import { PermissionCheckerService } from 'abp-ng2-module';

Please advise me.


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Could you share the related entity json file under "aspnet-core\AspNetZeroRadTool" folder ?

    Thanks,

  • User Avatar
    0
    [email protected] created

    Hi Ismcagdas, I cannot find how to attach the file. So I paste the content of the file: <span class="colour" style="color: rgb(0, 0, 0);">"aspnet-core\AspNetZeroRadTool&lt;/span>Dbo.QReservations.json<span class="colour" style="color: rgb(0, 0, 0);">".</span> <span class="colour" style="color: rgb(0, 0, 0);">If you need the other files of information, please let me know.</span>

    I appreciate your help.

    ---------------------------------- Dbo.QReservations.json: { "IsRegenerate": true, "MenuPosition": "main", "RelativeNamespace": "Dbo", "EntityName": "QReservations", "EntityNamePlural": "QReservationses", "TableName": "QReservationses", "PrimaryKeyType": "int", "BaseClass": "Entity", "EntityHistory": false, "AutoMigration": true, "UpdateDatabase": true, "CreateUserInterface": true, "CreateViewOnly": true, "CreateExcelExport": true, "IsNonModalCRUDPage": false, "IsMasterDetailPage": false, "PagePermission": { "Host": true, "Tenant": true }, "Properties": [ { "Name": "NameSurname", "Type": "string", "MaxLength": 100, "MinLength": 1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": true, "Nullable": false, "Regex": "", "UserInterface": { "AdvancedFilter": true, "List": true, "CreateOrUpdate": true } }, { "Name": "CheckinDate", "Type": "DateTime", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": false, "Regex": "", "UserInterface": { "AdvancedFilter": true, "List": true, "CreateOrUpdate": true } }, { "Name": "TotalNights", "Type": "int", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": true, "MinimumValue": 1.0, "MaximumValue": 30.0 }, "Required": false, "Nullable": false, "Regex": "", "UserInterface": { "AdvancedFilter": true, "List": true, "CreateOrUpdate": true } }, { "Name": "IsPaid", "Type": "bool", "MaxLength": -1, "MinLength": -1, "Range": { "IsRangeSet": false, "MinimumValue": 0.0, "MaximumValue": 0.0 }, "Required": false, "Nullable": false, "Regex": "", "UserInterface": { "AdvancedFilter": true, "List": true, "CreateOrUpdate": true } } ], "NavigationProperties": [], "NavigationPropertyOneToManyTables": [], "EnumDefinitions": [], "DbContext": null }

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @[email protected]

    Thanks, it seems like there is a bug in Power Tools and it will be fixed in 3.0 version we are planning to release today or tomorrow. For now, you can open app-navigation.service.ts and move the menu item to appropriate place to fix this problem.