Open Closed

Suite result is full of errors when using the new File entity #7424


User avatar
0
Sturla created

I you try to create db from these entites https://ufile.io/ajc1x5q2 (that were just created out of Suite) then there are lots of things wrong

  • UploadFileAsync method nowhere to be found
  • MaxFileUploadSize nowhere to be found
  • Namespaces not found or missing

I don´t know if it matters but I´m creating this inside a module.

Jobs being master and JobFiles being child.

Here are the rest of the errors

*

  • UI Type: Blazor Server 8.2.0
  • Database System: EF Core
  • Tiered (for MVC) or Auth Server Separated (for Angular): no

5 Answer(s)
  • User Avatar
    0
    Sturla created

    If I then just comment all the File "stuff" out to in the UI (just the UI) I get the following error when running

    Autofac.Core.DependencyResolutionException: An exception was thrown while activating ContractWorkModule.JobFiles.JobFilesAppService.
     ---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'ContractWorkModule.JobFiles.JobFilesAppService' can be invoked with the available services and parameters:
    Cannot resolve parameter 'Volo.Abp.Domain.Repositories.IRepository`2[ContractWorkModule.AppFileDescriptors.AppFileDescriptor,System.Guid] appFileDescriptorRepository' of constructor 'Void .ctor(ContractWorkModule.JobFiles.IJobFileRepository, ContractWorkModule.JobFiles.JobFileManager, Volo.Abp.Caching.IDistributedCache`2[ContractWorkModule.JobFiles.JobFileDownloadTokenCacheItem,System.String], Volo.Abp.Domain.Repositories.IRepository`2[ContractWorkModule.AppFileDescriptors.AppFileDescriptor,System.Guid], Volo.Abp.BlobStoring.IBlobContainer`1[ContractWorkModule.JobFiles.JobFileFileContainer])'.
    

    so now I´m trying to track that down... It seems that the suite part has not been tested that much for this File thing..

    UPDATE I solved that one by adding this line to my ContractWorkModuleApplicationModule but then I had to add my EntityFrameworkCore project that has my database context as a reference. Is that the way to go for a module?

    context.Services.AddTransient<IRepository<AppFileDescriptor, Guid>, EfCoreRepository<ShowCasasDbContext, AppFileDescriptor, Guid>>();

    BUT now I´m getting the following error

    [10:55:21 DBG] Get dynamic claims cache for user: 56e99f30-fe1a-429f-44c4-3a137061d937
    [10:55:21 INF] Request finished HTTP/2 GET https://localhost:44369/Pages/Jobs.razor.js - 404 0 null 34.0081ms
    [10:55:21 INF] Request reached the end of the middleware pipeline without being handled by application code. Request path: GET https://localhost:44369/Pages/Jobs.razor.js, Response status code: 404
    [10:55:22 WRN] Unhandled exception rendering component: Failed to fetch dynamically imported module: https://localhost:44369/Pages/Jobs.razor.js
    TypeError: Failed to fetch dynamically imported module: https://localhost:44369/Pages/Jobs.razor.js
    Microsoft.JSInterop.JSException: Failed to fetch dynamically imported module: https://localhost:44369/Pages/Jobs.razor.js
    TypeError: Failed to fetch dynamically imported module: https://localhost:44369/Pages/Jobs.razor.js
       at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
       at ContractWorkModule.Blazor.Pages.ContractWorkModule.Jobs.OnAfterRenderAsync(Boolean firstRender) in C:\Dev\NineKeys.ShowCasas\aspnet-core\modules\ContractWorkModule\src\ContractWorkModule.Blazor\Pages\ContractWorkModule\Jobs.razor.cs:line 111
       at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
    [10:55:22 ERR] Unhandled exception in circuit 'zCPhR6vkqJKDFKyFgew8tT-7NvbRH6KsYgbbCL9rOII'.
    Microsoft.JSInterop.JSException: Failed to fetch dynamically imported module: https://localhost:44369/Pages/Jobs.razor.js
    TypeError: Failed to fetch dynamically imported module: https://localhost:44369/Pages/Jobs.razor.js
       at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
       at ContractWorkModule.Blazor.Pages.ContractWorkModule.Jobs.OnAfterRenderAsync(Boolean firstRender) in C:\Dev\NineKeys.ShowCasas\aspnet-core\modules\ContractWorkModule\src\ContractWorkModule.Blazor\Pages\ContractWorkModule\Jobs.razor.cs:line 111
       at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
    [10:55:22 DBG] Get dynamic claims cache for user: 56e99f30-fe1a-429f-44c4-3a137061d937
    [10:55:22 INF] Executed endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint'
    [10:55:22 INF] Request finished HTTP/2 CONNECT https://localhost:44369/_blazor?id=A5k3AEkOw7p_-WHpWIf1HA - 200 null null 10154.4415ms
    [10:55:22 INF] Connection id "0HN4O57KU2NH1", Request id "0HN4O57KU2NH1:00000015": the application completed without reading the entire request body.
    

    UPDATE 2 I figured why the js was not being loaded.. it was trying to reference the js file from a totally wrong path (notice that my module has a module folder under pages (all genereated with Suite)

    BUT after pointing it to the .js I get the following error

    [11:11:32 WRN] Unhandled exception rendering component: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
    Microsoft.JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
       at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson, JSCallResultType resultType, Int64 targetInstanceId)
       at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, CancellationToken cancellationToken, Object[] args)
       at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
       at Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeVoidAsync(IJSObjectReference jsObjectReference, String identifier, Object[] args)
       at Blazorise.DataGrid.JSDataGridModule.Initialize(ElementReference elementRef, String elementId)
       at Blazorise.DataGrid.DataGrid`1.OnAfterRenderAsync(Boolean firstRender)
       at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
    [11:11:32 ERR] Unhandled exception in circuit 'cNIk9AF7tB-ZzTyDjjAGRWxePnRGsr20JCvkzZwBHk4'.
    Microsoft.JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
       at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson, JSCallResultType resultType, Int64 targetInstanceId)
       at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, CancellationToken cancellationToken, Object[] args)
       at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
       at Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeVoidAsync(IJSObjectReference jsObjectReference, String identifier, Object[] args)
       at Blazorise.DataGrid.JSDataGridModule.Initialize(ElementReference elementRef, String elementId)
       at Blazorise.DataGrid.DataGrid`1.OnAfterRenderAsync(Boolean firstRender)
       at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
    

    UPDATE 3 I could not fix the error above so I just commented all out BUT now I sometimes get this error

    [11:31:38 WRN] Unhandled exception rendering component: Collection was modified; enumeration operation may not execute.
    System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
      at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
      at Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components.ApplicationLayout.Common.ContentToolbar.mvtNVO0Qjc(RenderTreeBuilder  )
      at Blazorise.Row.&lt;BuildRenderTree&gt;b__24_2(RenderTreeBuilder __builder3)
      at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder)
      at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
    [11:31:38 ERR] Unhandled exception in circuit 'b8SskGnvorXXbNMQgrv2vO6JHWfGZCHdeQPmqprrUr0'.
    System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
      at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
      at Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components.ApplicationLayout.Common.ContentToolbar.mvtNVO0Qjc(RenderTreeBuilder  )
      at Blazorise.Row.&lt;BuildRenderTree&gt;b__24_2(RenderTreeBuilder __builder3)
      at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder)
      at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
    
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi sorry for the late response. I'll check this asap.

  • User Avatar
    0
    Sturla created

    Have you looked into this?

  • User Avatar
    0
    mfxws created

    Hi Sturla,

    I am having the same issue that my .razor.js file is not found as you described in the UPDATE section. My entity was generated by the ABP Suite too and is also placed in a subfolder of Pages. Changing the path didn't help. For some reason the .razor.js is not provided on the server or at least I cannot find it there. Is your .razor.js file automatically provided while debugging, or did you have to do some manual steps so that the resouce could be found?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Have you looked into this?

    Hi, I have tried just before but unfortunately, I'm unable to reproduce it, due to missing parts (enum files etc...). If it's possible can you share the full application via email with us, so we can better assist you?

Made with ❤️ on ABP v9.0.0-preview Updated on October 03, 2024, 12:03