admin管理员组文章数量:1318989
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:
- Consuming App with README:
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./phortx/ember-engines-engine
- Consuming App with README: https://github./phortx/ember-engines-app
3 Answers
Reset to default 6We 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 addember-engines
as a dependency in the package.json
both for the app and the engine. So we change
the package.json
to:
"dependencies": {
"ember-cli-htmlbars": "^1.0.10",
"ember-cli-babel": "^5.1.7",
"ember-data": "^2.10.0",
"ember-engines": "0.4.0"
}
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 engines index.js
).
4. Use the right resolver
You have to ensure, that both in the addon/engine.js
and the app/resolver.js
use the ember-resolver
.
5. Failed to load asset manifest.
This is probably a bug in ember-engines
. See the issue for more details: https://github./ember-engines/ember-engines/issues/282#issuement-268834293
You can workaround that issue by manually adding a <meta />
-Tag to the <head>
(see the GitHub issue link above)
Many thanks to Michael Donaldson!
I can't find reference to your Engine app from Consuming app package.json. I think you should add to Consuming package.json Engine app. For in-repo-addons - engines I can find in ember-engines-demo that in package.json they have:
"ember-addon": {
"paths": [
"lib/ember-chat-engine"
]
}
For not in-repo-addon, but for normal modules they have:
"dependencies": {
"ember-data": "^2.6.0",
"ember-engines": "dgeb/ember-engines#v0.2",
"ember-blog-engine": "dgeb/ember-blog-engine"
},
Notice ember-blog-engine. Here's full reference to their package.json.
However in your Consuming ember-engines-app app package.json does not list ember-engines-engine name.
Ember processes addons from package.json lists so you have to reference your engine addon there. Otherwise you will never get any line of code from such package executed in Ember CLI environment.
Please add your ember-engines-engine to consuming app package.json.
I'd add that inpatibility could also be an issue...
As Ember Engines is experimental and being developed against the master branches of Ember and Ember-CLI, be sure that you are using patible versions.
本文标签: javascriptHow to setup ember enginesStack Overflow
版权声明:本文标题:javascript - How to setup ember engines? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742054652a2418219.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论