Search code examples
migrationjavascripttemplate-engineractivejs

Why I get the error: "Attempted to unrender a fragment that was not rendered" when migrating from ractive.js 0.3.9 to 0.5.5


I have a long, complex and a little dirty set of templates that works OK in 0.3.9 but not in 0.5.5 where I get the error: "Attempted to unrender a fragment that was not rendered".

My template is very complex but I could reproduce a slice that works in 0.3.9 but not in 0.5.5.

This is how it works OK in 0.3.9: http://jsfiddle.net/Katio/ujx2e/

This template in 0.5.5 shows the mentioned error: http://jsfiddle.net/Katio/W3Lus/

Attempted to unrender a fragment that was not rendered

Edit 1:

Thaylon has opened an issue in Ractive project on Github: https://github.com/ractivejs/ractive/issues/1003


Solution

  • I must admit I'm not sure what the root of the problem is.

    Yet, change the beginning of line 33 in your template from:

    {{^.responsable}}<span class="redOutline" data-validationmess="Solicitud ({{num+1}}) '{{../../nombreSubdata.values[0]}}', secci&oacute;n '{{nombre.values[0]}}', responsable no asignado.">(responsable no asignado)</span>{{/.responsable}}
    

    to:

    {{^responsable}}<span class="redOutline" data-validationmess="Solicitud ({{num+1}}) '{{../../nombreSubdata.values[0]}}', secci&oacute;n '{{nombre.values[0]}}', responsable no asignado.">(responsable no asignado)</span>{{/responsable}}
    

    and it will render.

    http://jsfiddle.net/W3Lus/2/

    Edit

    A pretty minimal example that exhibits the error is: http://jsfiddle.net/W3Lus/9/

    Removing any part, even the static <option>, it will render.

    Doesnt look like you're doing anything wrong, seems to be a bug.

    Edit

    I assume binding the select value to {{.responsable}}, when it does not resolve to anything, causes this, as long as there is any option in the select that actually would be bound to the non-existing value.

    Edit

    Minimal examples with different buggy results: http://jsfiddle.net/W3Lus/13/ http://jsfiddle.net/W3Lus/12/

    One wont render at all, the other wont render a part that it should.