I've created a standalone routable engine with ember-engines
0.4.0
, ember-cli
2.10.0
.
I get this error if I call the engines index route (/thingy/
):
Assertion Failed: Asset manifest does not list any available bundles.
Consuming App router.js
:
this.mount('thingy-frontend', { as: 'thingy', path: 'thingy' });
Engine App routes.js
:
this.route('index', { path: '/' });
The engine is 'installed' via a symlink in the node_modules/
dir of the consuming ember-cli
app. (See here why).
Just for fun I've tried to change the routes to test if that works ...
Consuming App router.js
:
this.mount('thingy-frontend', { as: 'thingy' });
Engine App routes.js
:
this.route('index', { path: 'new' });
I've called /thingy/new
and got an UnrecognizedURLError
. Alternative, if I call the root path, I get an Assertion Failed: Asset manifest does not list any available bundles.
Also if I place a console.log('...');
in the engines index.js
, I can't see any output. Seems like it isn't loaded at all.
The setup was inspired by the official README and the official example repos.
Any idea how to fix this Ember Engines setup?
You can find the repos on GitHub:
- Engine: https://github.com/phortx/ember-engines-engine
- Consuming App with README: https://github.com/phortx/ember-engines-app
We could solve the issue. There have been several problems and I'll share with you what we did:
1. Add ember-engines as dependency (not just dev-dependency)
You have to add
ember-engines
as a dependency in thepackage.json
both for the app and the engine. So we change thepackage.json
to:Don't forget to
npm install
.2. Add the actual engine to the package.json
Even if it's not public and symlinked in node_modules like in our case, you have to add the engine to the
package.json
.In our case this was
"thingy-frontend": "*"
.Don't forget to
npm install
.3. Check symlink name
In our case the symlink had the name of the engine repo instead of the actual engine name. That won't work. We changed the symlink name to
thingy-frontend
(that's the name from the enginesindex.js
).4. Use the right resolver
You have to ensure, that both in the
addon/engine.js
and theapp/resolver.js
use theember-resolver
.5. Failed to load asset manifest.
This is probably a bug in
ember-engines
. See the issue for more details: https://github.com/ember-engines/ember-engines/issues/282#issuecomment-268834293You can workaround that issue by manually adding a
<meta />
-Tag to the<head>
(see the GitHub issue link above)Many thanks to Michael Donaldson!