Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handlebars 2.0 required for Ember 1.9.0 #11

Open
davidsteinberger opened this issue Dec 10, 2014 · 13 comments
Open

Handlebars 2.0 required for Ember 1.9.0 #11

davidsteinberger opened this issue Dec 10, 2014 · 13 comments

Comments

@davidsteinberger
Copy link

Ember 1.9.0 which has just been released requires Handlebars = 2.0. However ember-cli-bootstrap-sass ships with templates compiled for Handlebars 1.3.0.

I think what's required is a refresh of bootstrap-for-ember that compiles templates for Handlebars 2.0 and then a refresh of this plugin.

@unionups
Copy link
Owner

Yes, bootstrap-for-ember has templates compiled by Handlebars ~1 and not compateble with Ember 1.9 that require Handlebars ~2. Temporary you can fully exclude bootstrap-for-ember from the project by set components option to false or [] , until bootstrap-for-ember until will not be compatible with Handlebars ~2

//your-bootstrap-app/Brocfile.js

/* global require, module */

var EmberApp = require('ember-cli/lib/broccoli/ember-app');

var app = new EmberApp({
  'ember-cli-bootstrap-sass': {
    'components': false
  }
});

module.exports = app.toTree();

@maxkueng
Copy link

I tried the workaround above but it didn't work. While I can use Bootstrap in my SCSS files, it throws an error Error: Unknown template object: function on page load. It still renders the page even with the error. But the weirdest part is that it causes this.store inside the .model handler of a route (probably elsewhere too) to be undefined.

As soon as I uninstall ember-cli-bootstrap-sass this.store works as intended again. Adding 'components': false doesn't change anything.

"DEBUG: -------------------------------" vendor.js:17442
"DEBUG: Ember      : 1.9.0" vendor.js:17442
"DEBUG: Ember Data : 1.0.0-beta.12" vendor.js:17442
"DEBUG: EmberFire  : 1.3.1" vendor.js:17442
"DEBUG: Handlebars : 2.0.0" vendor.js:17442
"DEBUG: jQuery     : 1.11.1" vendor.js:17442
"DEBUG: -------------------------------"

@unionups
Copy link
Owner

First step is read this HANDLEBARS VERSION COMPATIBILITY about dependency and how-to ember-cli steps for right upgrade them to use Handlebars ~2:

In you case maybe need steps:

npm uninstall --save-dev broccoli-ember-hbs-template-compiler
npm install --save-dev ember-cli-htmlbars

You are use something like Emblem template compiler ?
If yes, current version of broccoli-emblem-compiler does not support Handlebars ~2
Temporary you can use my own fork of broccoli-emblem-compiler that fix this issue until official repo will be upgraded. Use the following rough steps:

  1. Remove ember-cli-emblem and broccoli-emblem-compiler from project if exists
npm uninstall --save-dev ember-cli-emblem
npm uninstall --save-dev broccoli-emblem-compiler
  1. Add to you dev dependecy in package.json file :
"broccoli-emblem-compiler": "unionups/broccoli-emblem-compiler"
  1. Install it:
npm install
  1. install ember-cli-emblem if need:
npm install --save-dev ember-cli-emblem

@maxkueng
Copy link

Thanks for the detailed instructions. I'm using ember-cli 1.4. I have already done the steps you described according to the instructions on the Ember blog when upgrading from 1.8 to 1.9.

I'm using Handlebars 2.0.0 and I have ditched broccoli-ember-hbs-template-compiler in favor of ember-cli-htmlbars. But the described workaround still didn't have an effect.

I don't need the components in bootstrap-for-ember so I have temporarily switched to ember-cli-sass + bootstrap-sass-official from Bower.

I couldn't continue work otherwise because of the weird issue with this.store. I also noticed that it didn't fully load/integrate Emberfire. It didn't even appear in the debug message. When I uninstalled ember-cli-bootstrap-sass everything returned back to normal.

@davidsteinberger
Copy link
Author

Do u think you could put together a small project that we could look at?

@bj-mcduck
Copy link

@maxkueng In a similar situation, don't need the components currently but am trying to migrate to ember-cli.

Did you get bootstrap and compass setup together? If so, which packages did you use?

@bj-mcduck
Copy link

Just got a working setup of bootstrap sass and compass with ember-cli-compass-bootstrap and very minimal configuration. Just starting with it, but seems to be working.

@maxkueng
Copy link

@brandonjmckay I'm now using ember-cli-sass which works but there's another issue with the includePaths option which doesn't seem to work with my setup. So I currently have to include Bootstrap using the full path bower_components/bootstratp/bla_bla_bla.

I'm trying out Materialize now but it has the same problem with ember-cli-sass. Not ideal but it works.

@jozefvaclavik
Copy link

+1 here.. I'm having same issue with ember-cli-bootstrap-sass & ember 1.9.1 with Handlebars 2.0.0. But setting

var app = new EmberApp({
  'ember-cli-bootstrap-sass': {
    'importBootstrapJS': true,
    'components': false
  }
});

helped.

@zekefast
Copy link

@maxkueng could you run bower list | grep -B 20 "1.3.0" and ensure that no components of you projects depends on Handlebars v1.3.0. Increase 20 if it won't show parent packet which depends on handlebars v1.3.0.

@maxkueng
Copy link

@zekefast I have since switched to ember-cli-sass as I've mentioned in another comment. With my current setup the command you've provided doesn't print anything.

If I just grep for "handlebars" in my current setup I get 2.0 everywhere.

[max@terror ramsch-ember]$ bower list | grep handlebars
│ ├── handlebars#2.0.0
├── handlebars#2.0.0

@terryroe
Copy link

Is there a plan to fix this? If so, could someone report on the status of the fix? Thanks.

@zekefast
Copy link

zekefast commented Feb 4, 2015

@maxkueng that means you have no indirect dependencies on handlebars 1.3.0 and you are in a good shape! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants