emberjs / ember.js

Ember.js - A JavaScript framework for creating ambitious web applications
https://emberjs.com
MIT License
22.45k stars 4.21k forks source link

Rehydration: Cannot find serialized cursor for `in-element` #18020

Closed josemarluedke closed 1 year ago

josemarluedke commented 5 years ago

I'm having an issue using -in-element and rehydration (FastBoot).

The code works if rehydration is disabled, but fails while rehydrating the generated code from FastBoot.

Uncaught Error: Cannot find serialized cursor for `in-element`
    at RehydrateBuilder.getMarker (runtime.js:6112)
    at RehydrateBuilder.__pushRemoteElement (runtime.js:6117)
    at RehydrateBuilder.pushRemoteElement (runtime.js:3631)
    at Object.evaluate (runtime.js:1053)
    at AppendOpcodes.evaluate (runtime.js:73)
    at LowLevelVM.evaluateSyscall (runtime.js:3472)
    at LowLevelVM.evaluateInner (runtime.js:3418)
    at LowLevelVM.evaluateOuter (runtime.js:3410)
    at VM.next (runtime.js:5531)
    at TemplateIteratorImpl.next (runtime.js:5633)

A reproduction of the error can be found here: https://github.com/josemarluedke/--rehydration-in-element

knownasilya commented 4 years ago

Looks like this same issue happens with ember-page-title in 3.14, see https://github.com/adopted-ember-addons/ember-page-title/issues/155

rwjblue commented 4 years ago

I think it should have been fixed as part of https://github.com/glimmerjs/glimmer-vm/pull/988, but I'd need to double check.

st-h commented 4 years ago

@rwjblue any news on this? If you have a pointer where/what to check I'll try to find some time to look into it.

rwjblue commented 4 years ago

Sorry for the laziness, but can y'all confirm that this is fixed in v3.17?

st-h commented 4 years ago

@rwjblue thanks for getting back to this. Things look good with 3.17 - However so far I just did a quick test.

josemarluedke commented 4 years ago

I just tested this out and it did fix the issue where the target element is a child of body.

However, if the target element is document.body, then the following issue occurs:

runtime.js:6303 Uncaught (in promise) TypeError: Cannot read property 'removeChild' of null
    at RehydrateBuilder.remove (runtime.js:6303)
    at RehydrateBuilder.clearMismatch (runtime.js:6176)
    at RehydrateBuilder.__closeBlock (runtime.js:6241)
    at RehydrateBuilder.popBlock (runtime.js:274)
    at Object.evaluate (runtime.js:3805)
    at AppendOpcodes.evaluate (runtime.js:2004)
    at LowLevelVM.evaluateSyscall (runtime.js:4906)
    at LowLevelVM.evaluateInner (runtime.js:4862)
    at LowLevelVM.evaluateOuter (runtime.js:4854)
    at JitVM.next (runtime.js:5798)

Updated reproduction is here: https://github.com/josemarluedke/--rehydration-in-element

sandstrom commented 1 year ago

rwjblue thanks for getting back to this. Things look good with 3.17 - However so far I just did a quick test.

I'm closing this.

If the other issue mentioned is still a problem (https://github.com/emberjs/ember.js/issues/18020#issuecomment-608637255), please open a new issue for it.