Base solution for your next web application
Open Closed

Issue - ASP.NET Core& Angular .Net Core 2.1 #5252


User avatar
0
gbadenhorst created

Hi,

I am experiencing a weird issue in the template when generating functionality with Rad Tool. (I don't think the issue is Rad related though)

After i generate my entity and run the project i get this error:

ERROR in src/app/main/BusinessPartners/businessPartners/create-or-edit-businessPartner-modal.component.ts(52,6): error TS2339: Property 'finally' does not exist on type 'Observable<void>'. src/app/main/ProjectTasks/projectTasks/create-or-edit-projectTask-modal.component.ts(57,6): error TS2339: Property 'finally' does not exist on type 'Observable<void>'. src/app/main/Projects/projects/create-or-edit-project-modal.component.ts(57,6): error TS2339: Property 'finally' does not exist on type 'Observable<void>'.

When i comment out:

//.finally(() => { this.saving = false; })

Everything runs fine.

The stranger part comes in with the objects in typescript. When i open the CreateOrEdit ts file, i can barely "use" the objects without referencing back to the back end code. An example of this issue would be: I generated the object as FullAudited however the audit related properties such as Id is missing. Attached screenshot as example :

[attachment=0:2qv405h4]image1.PNG[/attachment:2qv405h4]

This is the case for quite a few properties, some strings are shown as booleans however when inspecting it it is created as a string(which is correct) by nswag.

I am not 100% sure how to explain some of these property related issues.

Is there some updates I need to run for some of the software since 5.4.1 or is it an issue currently in the template?

Thanks, Gideon


12 Answer(s)
  • User Avatar
    0
    chauey created

    I also got that "finally" error.

    UPDATE: I think it's related to moving from rxjs 5 to 6 ("rxjs": "^6.2.0"), and the compatibility library was removed from package.json ("rxjs-compat": "6.0.0-tactical-rc.1")

    <a class="postlink" href="https://github.com/ReactiveX/rxjs/blob/master/docs_app/content/guide/v6/migration.md">https://github.com/ReactiveX/rxjs/blob/ ... gration.md</a>

    Assuming the newer RadTool templates are updated for this but have not tested/tried.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @GBadenhorst, yes it is related to RxJs 6 upgrade and removing rxjs-compat library. So, you should use finalize instead of finally like below;

    import { finalize } from 'rxjs/operators';
    
    this._accountService.isTenantAvailable(input)
                .pipe(finalize(() => { this.saving = false; }))
                .subscribe((result: IsTenantAvailableOutput) => {
                    // your code here...
                });
    
  • User Avatar
    0
    chauey created

    Has or when will the RadTool templates be updated for this? Currently we would need to add custom template if not updated? Thanks

  • User Avatar
    0
    alper created
    Support Team

    hi,

    you'll get an update today or at least tomorrow.

  • User Avatar
    0
    chauey created

    Oh, good to know. I've been working through these issues. How do we know when templates are updated? post here or twitter or ... And how do we get? running the Radtool from VS Studio 2017 will get latest and overwrite the dll and template txts but running through command line doesn't get latest dll I assume?

    in addition to the "finally" issue, I also saw other compile errors for Angular:

    • UIComponent (a custom entity) was not generated consistently so sometimes uiComponent and sometimes uIComponent. ALSO in HTML, no compile-time errors. also the URL/routes are affected
    • Setting the "DuplicationNumber": 2 also generated inconsistent property names, mismatch
    • numeric properties for filtering were instantiated to ''

    On the .NET side, the main problem was the identical Lookup Dto names in different namespaces. Basically like someone else said, make only a shared/common set. I wonder if can/will generate these one folder up in it's own shared Dtos folder and referenced to there?

    Lastly, if generate about 20 files and run npm start, does it take over 5 10 minutes? especially at 92% during the SourceMapDevToolPlugin running?

  • User Avatar
    0
    ismcagdas created
    Support Team

    On the .NET side, the main problem was the identical Lookup Dto names in different namespaces. Basically like someone else said, make only a shared/common set. I wonder if can/will generate these one folder up in it's own shared Dtos folder and referenced to there?

    This is not possible for now.

    Lastly, if generate about 20 files and run npm start, does it take over 5 10 minutes? especially at 92% during the SourceMapDevToolPlugin running?

    We haven't faced such a problem but some of our customers did. Could you try this <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/1222#issuecomment-393608255">https://github.com/aspnetzero/aspnet-ze ... -393608255</a> ?

  • User Avatar
    0
    chauey created

    Thanks,

    How/where to know when newer RadTool is published/ready?

  • User Avatar
    0
    ultimatemm created

    Hi Chauey,

    I think they fixed RadTool problems. Now I can generate with RadTool and working.:). RadTool is auto update via VS. Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Yes, RAD Tool is updated as well :)

  • User Avatar
    0
    dparizek created

    What about for Mac? How should Mac users get updated RAD tool?

  • User Avatar
    0
    ismcagdas created
    Support Team

    It is updated on <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/tree/dev/aspnet-core/AspNetZeroRadTool">https://github.com/aspnetzero/aspnet-ze ... eroRadTool</a>. You can download the folder and use it in your project.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @dparizek just a reminder, don't override your config.json :)