Bolero icon indicating copy to clipboard operation
Bolero copied to clipboard

Hot reload causing template to drop class attribute

Open Bananas-Are-Yellow opened this issue 1 year ago • 1 comments

I have a template file that contains two templates:

<template id="Section">
    <p class="panel-heading is-size-7 p-1 is-radiusless">
        ${Title}
    </p>
</template>

<template id="NoteCard">
    <div class="note-card">
    ...

These templates are instantiated several times on the page.

The content is client-side generated. Initially, the page displays correctly but when I interact with the page to cause it to update, instances of the first template used have the class attribute missing. So, instead of this:

<p class="panel-heading is-size-7 p-1 is-radiusless">
    My Title
</p>

I get this:

<p>
    My Title
</p>

My code uses the Section template first, so this is the one that shows the problem. But if I copy the HTML and create a template from a plain string instead, then the NoteCard template is the one that has the problem and the class="note-card" attribute missing.

The problem only occurs if hot reloading is enabled. To disable hot reloading, I can build a Release configuration, or I can comment out the hot reloading code (AddHotReload, UseHotReload, and Program.withHotReload).

Bananas-Are-Yellow avatar Jan 19 '24 17:01 Bananas-Are-Yellow

The problem started after I updated from .NET 7 to .NET 8 along with the following Bolero updates:

image

Bananas-Are-Yellow avatar Jan 20 '24 08:01 Bananas-Are-Yellow