Why is my JavaScript function not found only in debug?

Viewed 294

I define this inside body section of index.html

    <script>
        function BlazorRegisterStorageEvent(component) {
            window.addEventListener("storage", async e => {
                await component.invokeMethodAsync("OnStorageUpdated", e.key);
            });
        }
    </script>

From Visual Studio 2019 If I start application without debugger (crtl-F5) it works fine. If I start application WITH debugger I have this exception:

Unhandled exception rendering component: Could not find 'BlazorRegisterStorageEvent' ('BlazorRegisterStorageEvent' was undefined).

Thank you

1 Answers

Sorry after cleaning chrome cache works fine also in debug.

Related