Closed fingers10 closed 1 year ago
@fingers10 Thank you for your reporting! I want to investigate this problem, but I don't have enough time right now. Please wait for a few days. Thanks!
@fingers10
I published the fixed new version of the "BlazorWasmPreRendering.Build".
Could you try it out?
Thank you for your contributions!
@jsakamoto Thank you for your support. I checked and it works fine.
@jsakamoto I was deploying the published version and got the below runtime error. This error doesn't appear when I published the same blazor wasm project without this package.
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Cannot read properties of null (reading 'insertBefore')
TypeError: Cannot read properties of null (reading 'insertBefore')
at x (https://localhost:44354/_framework/blazor.webassembly.js:1:17125)
at M (https://localhost:44354/_framework/blazor.webassembly.js:1:16836)
at se.insertComponent (https://localhost:44354/_framework/blazor.webassembly.js:1:24352)
at se.insertFrame (https://localhost:44354/_framework/blazor.webassembly.js:1:23075)
at se.applyEdits (https://localhost:44354/_framework/blazor.webassembly.js:1:21490)
at se.updateComponent (https://localhost:44354/_framework/blazor.webassembly.js:1:20774)
at https://localhost:44354/_framework/blazor.webassembly.js:1:59545
at Vt.Ke._internal.renderBatch (https://localhost:44354/_framework/blazor.webassembly.js:1:59917)
at Object.Gt [as invokeJSFromDotNet] (https://localhost:44354/_framework/blazor.webassembly.js:1:62760)
at Object.Ii (https://localhost:44354/_framework/dotnet.7.0.10.hufr6ztx9h.js:5:71974)
Microsoft.JSInterop.JSException: Cannot read properties of null (reading 'insertBefore')
TypeError: Cannot read properties of null (reading 'insertBefore')
at x (https://localhost:44354/_framework/blazor.webassembly.js:1:17125)
at M (https://localhost:44354/_framework/blazor.webassembly.js:1:16836)
at se.insertComponent (https://localhost:44354/_framework/blazor.webassembly.js:1:24352)
at se.insertFrame (https://localhost:44354/_framework/blazor.webassembly.js:1:23075)
at se.applyEdits (https://localhost:44354/_framework/blazor.webassembly.js:1:21490)
at se.updateComponent (https://localhost:44354/_framework/blazor.webassembly.js:1:20774)
at https://localhost:44354/_framework/blazor.webassembly.js:1:59545
at Vt.Ke._internal.renderBatch (https://localhost:44354/_framework/blazor.webassembly.js:1:59917)
at Object.Gt [as invokeJSFromDotNet] (https://localhost:44354/_framework/blazor.webassembly.js:1:62760)
at Object.Ii (https://localhost:44354/_framework/dotnet.7.0.10.hufr6ztx9h.js:5:71974)
at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[Int32,RenderBatch,Object,Object](String , Int32 , RenderBatch , Object , Int64 )
at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[Int32,RenderBatch,Object](String , Int32 , RenderBatch )
at Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer.UpdateDisplayAsync(RenderBatch& )
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
u @ blazor.webassembly.js:1
@fingers10 Thank you for reporting! But please isolate issues for each problem. (So please create a new issue for this problem.)
And, unfortunately, I could not figure out the reason for this error from the log you provided. So, could you provide me the project file that caused this error? Thank you for being so understanding. 😊
Dear @jsakamoto ,
I tried to publish a blazor wasm app from Visual Studio Folder Publish Profile and the publish failed. However it works perfectly with command line publish
dotnet publish
.Here are the necessary details:
7.0.10
blazor wasm project.<PackageReference Include="BlazorWasmPreRendering.Build" Version="3.0.0-preview.2" />
package.Program.cs
:if (!builder.RootComponents.Any()) { builder.RootComponents.Add("#app");
builder.RootComponents.Add("head::after");
}
ConfigureServices(builder.Services, builder.HostEnvironment.BaseAddress);
await builder.Build().RunAsync();
static void ConfigureServices(IServiceCollection services, string baseAddress) { services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(baseAddress) }); }
FolderPublish.xml
:dotnet publish
output2>Build failed. Check the Output window for more details.