mardi 17 juillet 2018

How to define nested routes with module unification turned on

I am new to Ember and am likely making a simple mistake somewhere, but I am having trouble getting nested routes (3 levels of nesting) working in a simple app with module unification turned on, in both ember 3.2.0 and 3.3.0.

(I was able to get the same routes working in another app without module unification.)

In my app, I have module unification turned on by setting the following environment variables in my .bashrc:

export EMBER_CLI_MODULE_UNIFICATION='true'
export MODULE_UNIFICATION='true'

Here are the relevant lines of my src/router.js:

Router.map(function() {
  this.route('peach', function() {
    this.route('pear', function() {
    });
  });
});

Here is src/ui/routes/peach/index/template.hbs:

peach


Here is src/ui/routes/peach/pear/index/template.hbs:

pear

Navigating to http://localhost:4200/peach/pear results in a blank browser page with the following error:

jQuery.Deferred exception: this._config.collections[specifier.collection] is undefined _checkDefaultType@http://localhost:4200/assets/vendor.js:69136:11

TypeError: this._config.collections[specifier.collection] is undefined

Why are these routes not working with module unification turned on, and how can I get them working?




Aucun commentaire:

Enregistrer un commentaire