I am playing with a small Blazor Wasm app in which I am trying various things to better learn how they work. Part of that includes JavaScript code that invokes Blazor methods as a way to pass object data from JS to Blazor. My problem is that there are
times when I make changes to the JS code, but the old code is what's used when I run the debugger. I thought I understood the pattern that leads to this, but just discovered that's not so. In particular, I had been switching between different versions of
the same JS function by simply commenting out all but the one I wanted to test. That's when it appeared the new code didn't load. So I started making a single change to a line of code (adding a character to a string literal), which seemed to work. But I
just did that and it didn't work. So, I'm back to needing to know what it takes to get JS code changes to be loaded? Is this a caching problem that I can overcome with some sort of parameter?
I am using Visual Studio Community 2019 v16.6.1 with AspNetCore v3.2.0 opening Chrome v83.0.4103.97. My launchSettings.json are shown below.
Member
26 Points
63 Posts
JavaScript Code Changes Not Being Loaded in Blazor Wasm App Run in Chrome
Jun 10, 2020 05:25 PM|CincySteve|LINK
I am playing with a small Blazor Wasm app in which I am trying various things to better learn how they work. Part of that includes JavaScript code that invokes Blazor methods as a way to pass object data from JS to Blazor. My problem is that there are times when I make changes to the JS code, but the old code is what's used when I run the debugger. I thought I understood the pattern that leads to this, but just discovered that's not so. In particular, I had been switching between different versions of the same JS function by simply commenting out all but the one I wanted to test. That's when it appeared the new code didn't load. So I started making a single change to a line of code (adding a character to a string literal), which seemed to work. But I just did that and it didn't work. So, I'm back to needing to know what it takes to get JS code changes to be loaded? Is this a caching problem that I can overcome with some sort of parameter?
I am using Visual Studio Community 2019 v16.6.1 with AspNetCore v3.2.0 opening Chrome v83.0.4103.97. My launchSettings.json are shown below.
Thanks. Steve