Open Closed

abp suite error while generate angular code : StartIndex cannot be less than zero. (Parameter 'startIndex') #4216


User avatar
0
Moamen.Omar created
  • ABP Framework version: v6.0.2

  • UI type: Angular

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): yes

  • Exception message and stack trace: StartIndex cannot be less than zero. (Parameter 'startIndex') System.ArgumentOutOfRangeException: StartIndex cannot be less than zero. (Parameter 'startIndex') at System.String.Substring(Int32 startIndex, Int32 length) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.hmfqxJ9ca4(Boolean , String , String ) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.VWyqnsr0CL(Boolean ) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.NMkG67TdTd() at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.ExecuteAsync(CrudPageCommandOptions options) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.CommandManager.ExecuteAllAsync(CrudPageCommandOptions options) at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.CrudPageGenerator.GenerateAsync(EntityModel entity, Solution solution) at Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync(Guid solutionId, EntityModel entity) at lambda_method1847(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.

  • Steps to reproduce the issue:"

When I try to generate interface code on my angular project by using abp suite

note that the abp suit is updated, I tried to uninstall the abp suit and reinstall it again and still I have the same issue


11 Answer(s)
  • User Avatar
    0
    gizem.kurt created
    Support Team QA Test Engineer

    I did not get an error when I created a project with 6.0.2 and applied the genarate operation. A different situation in your project may be causing this error. If you let us know your project via Drive, we can review it.

  • User Avatar
    0
    Moamen.Omar created

    check the project below

    https://drive.google.com/file/d/1QCpLn-***************usRYXVfvm/view?usp=sharing

  • User Avatar
    0
    gizem.kurt created
    Support Team QA Test Engineer

    We will review and get back to you.

  • User Avatar
    0
    gizem.kurt created
    Support Team QA Test Engineer

    We examined the error through your project. If you add the method in the screenshot, the problem will be fixed.

  • User Avatar
    0
    Moamen.Omar created

    The Error was resolved but the it did not generate any code or files on my angular project

    no files added or generated for the new created entity

  • User Avatar
    0
    gizem.kurt created
    Support Team QA Test Engineer

    We will check and we will get back to you.

  • User Avatar
    0
    muhammedaltug created

    Hello,

    The generate-proxy.json file is an invalid JSON file. Please try after removing your proxy folder and regenerating it with abp generate-proxy -t ng command.

  • User Avatar
    0
    Moamen.Omar created

    i will check it and get back to you with feed back tomorrow

  • User Avatar
    0
    Moamen.Omar created

    can you tell me what is the exact issue in the generate-proxy.json, since our angular project has some custom forms developed by us and when I delete the proxy folder and regenerate it there are a lot of files I do not need them was generated

  • User Avatar
    0
    muhammedaltug created

    Hello

    generate-proxy.json file has two api-defition responses. The second response starts from line 1381. If you don't want to generate from scratch, you can modify the file so as to include only one response and generate proxies with the existing generate-proxy.json with commands below

    ng g @abp/ng.schematics:api --module=app --apiName=Default --source=__default --target=__default 
    
    ng g @abp/ng.schematics:proxy-index --target=__default 
    
  • User Avatar
    0
    Moamen.Omar created

    sorry for the delay we will check this today, thanks.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15