Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Loading Blazorise when selfhosting #3324

Closed
samuelhurni opened this issue Jan 14, 2022 · 5 comments
Closed

Error Loading Blazorise when selfhosting #3324

samuelhurni opened this issue Jan 14, 2022 · 5 comments
Labels
Type: Bug 🐞 Something isn't working

Comments

@samuelhurni
Copy link

Describe the bug
I did a Blazor WASM Project with Blazorise and want to Deploy the App at my Synology NAS in a docker Container with ngInx.

First of all, I deploy the app to a folder structure. There I start to test a python http server. Wen I run the application on localhost, I get an error while loading the staring page.
The error is:

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec. blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Failed to fetch dynamically imported module: http://localhost:8000/_content/Blazorise/breakpoint.js?v=0.9.5.3 TypeError: Failed to fetch dynamically imported module: http://localhost:8000/_content/Blazorise/breakpoint.js?v=0.9.5.3 Microsoft.JSInterop.JSException: Failed to fetch dynamically imported module: http://localhost:8000/_content/Blazorise/breakpoint.js?v=0.9.5.3 TypeError: Failed to fetch dynamically imported module: http://localhost:8000/_content/Blazorise/breakpoint.js?v=0.9.5.3 at Microsoft.JSInterop.JSRuntime.<InvokeAsync>d__151[[Microsoft.JSInterop.IJSObjectReference, Microsoft.JSInterop, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext()
at Blazorise.Modules.JSBreakpointModule.RegisterBreakpoint(DotNetObjectReference1 dotNetObjectRef, String elementId) at Blazorise.Bar.OnFirstAfterRenderAsync() at Blazorise.BaseComponent.OnAfterRenderAsync(Boolean firstRender) at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task )

I did it also with an empty Blazor WASM Project and then there was no error for hosting the app localy with a python server.

@samuelhurni samuelhurni added the Type: Bug 🐞 Something isn't working label Jan 14, 2022
@stsrki
Copy link
Collaborator

stsrki commented Jan 14, 2022

We already had similar problems with JS modules: #3122, #3150

Can you see if any of the solutions in the posted issues can solve your problem? For example .UseStaticFiles(). usually works.

@David-Moreira
Copy link
Contributor

David-Moreira commented Jan 31, 2022

@samuelhurni
Can you let us know if this helped? Or are you having a different issue then the one's reported?

To me it seems that your web server should communicate a Mime type of js when delivering the requested resource, which would be server configuration.

Let us know how it is going.

@samuelhurni
Copy link
Author

samuelhurni commented Feb 3, 2022 via email

@David-Moreira
Copy link
Contributor

David-Moreira commented Feb 3, 2022

Hello @samuelhurni
So we can assume the problem is with the server configuration. May we close this issue?
Or would you like to leave it open and eventually provide us with further details, see if we can help on the Blazorise's part somehow?

@samuelhurni
Copy link
Author

Was only a server config issue, with apache or ngnix no problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants