addon breaks other addons
Hey, I just came to this really weird situation where I wasn't able to import things from a namespaced addon when running on production environment.
The root of the issue is ember-cli-bootstrap, If I remove it then everything works as expected.
I created the following repo where the issue can be reproduced https://github.com/abuiles/______ember-with-csrf
Run ember server --environment production and then go to localhost:4200, you will see the errors:
2014-10-14 08:31:00.240Uncaught TypeError: undefined is not a function vendor-a1334da90d004ed95bee447978c6258d.js:15
2014-10-14 08:31:00.243Uncaught Error: Could not find module rails-csrf/config vendor-a1334da90d004ed95bee447978c6258d.js:1
If I remove ember-cli-bootstrap the issue disappears.
Thanks @abuiles, I'll dig in to this when I get some time
@linstula thanks! btw this is only when env==production
Sorry, closed it by mistake.
@linstula quick update, I just nailed down the issue to the following lines in the index.js
app.import(path.join(javascriptsPath, 'bs-core.max.js')); // Import bs-core first
jsFiles.forEach(function(file) {
var fileName = file.split('.')[0];
app.import(path.join(javascriptsPath, fileName + '.max.js'));
});
:+1:
@linstula is something around here https://github.com/dockyard/ember-cli-bootstrap/blob/master/vendor/ember-addons.bs_for_ember/dist/js/bs-core.max.js#L418
Edit: If I uncomment the following it works https://github.com/dockyard/ember-cli-bootstrap/blob/master/vendor/ember-addons.bs_for_ember/dist/js/bs-core.max.js#L420
@linstula The root of the problem is the following Ember.Handlebars.compile in https://github.com/dockyard/ember-cli-bootstrap/blob/master/vendor/ember-addons.bs_for_ember/dist/js/bs-core.max.js#L420
When running ember build --production ember-cli builds with handlebars.runtime.js which doesn't have .compile.
More info https://github.com/ember-addons/bootstrap-for-ember/issues/87
I was under the impression that bootstrap_for_ember had resolved their issues with using Ember.Handlebars.compile. Thanks for tracking this down. I'll dig into it and see what can be done but likely wont have time until next week to do so.