Open topaxi opened 6 years ago
Can you add a reproduction? A twiddle or repo would be fine.
Thank you!
Okay this is caused by a liquid-bind
in my application.hbs
which binds a value from a service. The service value gets updated in the index
route beforeModel
hook, I guess this is bad practice or not supported? :)
(This works fine without loading routes though)
It also works without liquid-bind
and a regular value, maybe it is a liquid-fire issue after all?
Sadly I'm not able to reproduce this in a minimal app :(
I don't think we can do much without a repro on this...
I could reproduce the error mentioned in the liquid-fire issue #530.
git clone https://github.com/topaxi/fastboot-loading-states
cd fastboot-loading-states
ember s
FastBoot console output upon visit:
There was an error running your app in fastboot. More info about the error:
TypeError: Cannot read property 'createComment' of undefined
at ListBlockOpcode.evaluate (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/@glimmer/runtime.js:6759:1)
at UpdatingVM.execute (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/@glimmer/runtime.js:6495:1)
at RenderResult.rerender (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/@glimmer/runtime.js:6853:1)
at RootState._this.render (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/ember-glimmer/renderer.js:69:1)
at exports.runInTransaction (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/ember-metal.js:674:1)
at InertRenderer._renderRoots (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/ember-glimmer/renderer.js:341:1)
at InertRenderer._renderRootsTransaction (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/ember-glimmer/renderer.js:379:1)
at InertRenderer._revalidate (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/ember-glimmer/renderer.js:418:1)
at invokeWithOnError (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/backburner.js:281:1)
at Queue.flush (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/backburner.js:152:1)
at DeferredActionQueues.flush (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/backburner.js:343:1)
at Backburner.end (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/backburner.js:451:1)
at Timeout.Backburner._boundAutorunEnd [as _onTimeout] (/home/dsenn/gitty/github/fastboot-loading-states/tmp/broccoli_merge_trees-output_path-wTqgLUnw.tmp/assets/backburner.js:413:1)
at ontimeout (timers.js:469:11)
at tryOnTimeout (timers.js:304:5)
at Timer.listOnTimeout (timers.js:264:5)
I'm not sure how closely related this is to my specific case though as I've been unable to reproduce the crash I got once I remove liquid-fire from my actual app.
Here's a minimal bug repro. Took a couple of days, I've been taking away parts of a production app until only this was left:
// routes/application.js
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { next } from '@ember/runloop';
import RSVP from 'rsvp';
export default Route.extend({
fastboot: service(),
model() {
let deferred = RSVP.defer();
if (this.get('fastboot.isFastBoot')) {
this.get('fastboot').deferRendering(deferred.promise);
}
let controller = this.controllerFor(this.routeName);
controller.set('data', [1]);
next(() => {
controller.set('data', [2]);
deferred.resolve();
});
}
});
// controllers/application.js
import Controller from '@ember/controller';
export default Controller.extend({
});
{{!-- templates/application.js --}}
{{#each data}}
{{/each}}
ember-cli-fastboot
in devDependenciesWe're hitting this in our app as well. the deferRendering
seems to be a big part of it for us
Howdy folks 👋
I've just hit this issue while working on the new guides-app and I have a 100% reproducible way of hitting this bug, and we're not using any liquid-fire it's just the presence of the loading template that causes this issue
Steps to reproduce:
One of the issues that I am sure is causing problems reproducing this issue is that it doesn't seem to be consistent. The reason I am able to say that this method reproduces it 100% is because that prember is configured to pre-render about 300 pages, so at least one of them will have an issue guaranteed.
@CvX @mansona @mazondo @rwjblue @topaxi is this still an issue, perhaps we should close or create a new reproduction of this, what do you think?
@pixelhandler this is still happening with my reproduction repository posted above.
Installed dependencies (using ember-cli@3.4.3
installing latest fastboot and liquid-fire):
{
"devDependencies": {
"ember-cli": "~3.4.3",
"ember-cli-fastboot": "^2.0.0",
"ember-source": "~3.4.0",
"liquid-fire": "^0.29.5
}
}
Just a note that this is still an issue the latest versions of Ember (3.10) + FastBoot (2.1.0), I'm able to reliably reproduce it by having a loading template in my app.
I get the following error in my app:
At first I thought liquid-fire (#530) was causing this. But after removing liquid-fire I got the error above.