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

help-not-able-to-debug-wasm (and counter click not working) #239

Closed
jkone27 opened this issue Oct 27, 2021 · 1 comment
Closed

help-not-able-to-debug-wasm (and counter click not working) #239

jkone27 opened this issue Oct 27, 2021 · 1 comment

Comments

@jkone27
Copy link

jkone27 commented Oct 27, 2021

I have successfully adapted an existing app to use code from the Bolero template,

the client app loads fine (imported by the server app) but the counter doesnt seem to respond, and i don't have a way to debug/troubleshoot what's wrong missing there.

type MyApp() =
    inherit ProgramComponent<Model, Message>()

    override this.Program =
        let mockInfoService = this.Remote<IMockInfoService>()
        let update = update mockInfoService
        Program.mkProgram (fun _ -> initModel, (Cmd.ofMsg(SetPage Page.Home))) update view
        |> Program.withRouter router
#if DEBUG
        |> Program.withHotReload
#endif

image

image

is there any hints/stuff i could check? (i am also doing a primer on blazor as i am not an expert on the field)

pages work fine (so i suppose routing works good/fine)
but just counter doesn't co-operate and the update function doesnt hit (tried adding a breakpoint there)

when I inspect page source it contains wasm js so that seems fine

<script src="_framework/blazor.webassembly.js"></script></body></html>

here i got this error in console (while with template sol all works good and i see some console logs in the browser), seems it cannot load the wasm correctly?

image

after googling seems connected to this, where instead of lowdash is looking for webassembly with a space, some formatting issues?

https://stackoverflow.com/questions/66144275/getting-404-notfound-for-blazor-webassembly-js-framework-files-not-found

@jkone27
Copy link
Author

jkone27 commented Oct 28, 2021

The issue was in the startup in my middleware path, prob also doing something wrong there now, but i got it working correctly, adding UseBlazorFrameworkFiles back also in the "root" middleware pipeline (even though wasm should be used only in /mockerysetup paths)

 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    member _.Configure(app: IApplicationBuilder, env: IWebHostEnvironment) =

        !app.UseBlazorFrameworkFiles()
            .UseStaticFiles()

        // /configure
        !app.MapWhen((fun (c : HttpContext) -> c.Request.Path.ToString().Contains("/mockerysetup")),
                fun (z : IApplicationBuilder) ->

                    !z.UseBlazorFrameworkFiles()
                        .UseStaticFiles()
                        .UseRemoting()
                        .UseRouting()
                        .UseEndpoints(fun endpoints ->
                        #if DEBUG
                            !endpoints.UseHotReload()
                        #endif
                            !endpoints.MapBlazorHub()
                
                            !endpoints.MapFallbackToBolero(fun c ->
                                if c.Request.Path.ToString() = "/" then
                                    Index.oldView(c)
                                else
                                    Index.page
                        )
                )
            )
            .UseMiddleware<MockService>()

@jkone27 jkone27 closed this as completed Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant