Handlebars error prevents to load the app #11

Closed
millisami opened this Issue Feb 10, 2014 · 17 comments

Comments

Projects
None yet
2 participants
@millisami

Hi, to use the new feature query-params-new queryParams, I had to upgrade the handlebars to 1.3.0 and emberjs to canary version.

I did update both with the following cake tasks:

cake --channel canary emberjs:install
cake handlebars:install

Now when I start the app, I get the error:

Uncaught Template was precompiled with an older version of Handlebars than the current runtime. ..................

And this issue had also popped up before at wycats/handlebars.js#576

In the console:

Handlebars.VERSION
"1.3.0"
Em.VERSION
"1.5.0-beta.1+canary.2b50c3ae"

What should I do to get past this error in this skeleton?

@millisami

This comment has been minimized.

Show comment
Hide comment
@millisami

millisami Feb 10, 2014

After upgrading "ember-handlebars-brunch": "~1.1.0" to "ember-handlebars-brunch": "~1.2.0" also didn't fix it.

After upgrading "ember-handlebars-brunch": "~1.1.0" to "ember-handlebars-brunch": "~1.2.0" also didn't fix it.

@mutewinter

This comment has been minimized.

Show comment
Hide comment
@mutewinter

mutewinter Feb 11, 2014

Owner

This is an issue with ember-handlebars-brunch bartsqueezy/ember-handlebars-brunch#20.

I'm sure they'll get it sorted out before Handlebars 1.3.0 is a requirement. Until then, you can try my fork of ember-handlebars-brunch.

Owner

mutewinter commented Feb 11, 2014

This is an issue with ember-handlebars-brunch bartsqueezy/ember-handlebars-brunch#20.

I'm sure they'll get it sorted out before Handlebars 1.3.0 is a requirement. Until then, you can try my fork of ember-handlebars-brunch.

@millisami

This comment has been minimized.

Show comment
Hide comment
@millisami

millisami Feb 11, 2014

Well I tried your fork but still the error:

Uncaught Error: Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (>= 1.0.0) or downgrade your runtime to an older version (<= 1.0.rc.2). handlebars.js:425
Running in the development environment ember.js:3496
Uncaught TypeError: Cannot read property 'map' of undefine

Well I tried your fork but still the error:

Uncaught Error: Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (>= 1.0.0) or downgrade your runtime to an older version (<= 1.0.rc.2). handlebars.js:425
Running in the development environment ember.js:3496
Uncaught TypeError: Cannot read property 'map' of undefine
@mutewinter

This comment has been minimized.

Show comment
Hide comment
@mutewinter

mutewinter Feb 11, 2014

Owner

@millisami did you reference it like this in your package.json?

    "ember-handlebars-brunch": "https://github.com/mutewinter/ember-handlebars-brunch/tarball/master",
Owner

mutewinter commented Feb 11, 2014

@millisami did you reference it like this in your package.json?

    "ember-handlebars-brunch": "https://github.com/mutewinter/ember-handlebars-brunch/tarball/master",
@millisami

This comment has been minimized.

Show comment
Hide comment
@millisami

millisami Feb 11, 2014

Yea, I did. Here is my package.json file!

{
  "name": "tapas-with-ember",
  "description": "A Brunch skeleton for rapid Ember development. Including Ember install scripts, generators, and Ember.vim support.",
  "author": {
    "name": "Jeremy Mack",
    "email": "@mutewinter",
    "url": "http://twitter.com/mutewinter"
  },
  "version": "1.0.0",
  "homepage": "https://github.com/mutewinter/tapas-with-ember",
  "repository": {
    "type": "git",
    "url": "https://github.com/mutewinter/tapas-with-ember.git"
  },
  "engines": {
    "node": ">= 0.8.0"
  },
  "scripts": {
    "start": "cake server",
    "test": "./node_modules/.bin/testem"
  },
  "dependencies": {
    "brunch": "=1.7.13",
    "coffee-script": "~1.6.3",
    "javascript-brunch": "~1.7.1",
    "coffee-script-brunch": "~1.7.3",
    "css-brunch": "~1.7.0",
    "stylus-brunch": "~1.7.0",
    "uglify-js-brunch": "~1.7.6",
    "clean-css-brunch": "~1.7.1",
    "auto-reload-brunch": "~1.7.1",
    "ember-handlebars-brunch": "https://github.com/mutewinter/ember-handlebars-brunch/tarball/master",
    "semver": "~2.2.1",
    "adm-zip": "~0.4.3",
    "github": "~0.1.12",
    "digest-brunch": "~1.0.4",
    "canned": "~0.2.2"
  },
  "devDependencies": {
    "qunitjs": "*",
    "testem": "~0.5.15"
  }
}

Yea, I did. Here is my package.json file!

{
  "name": "tapas-with-ember",
  "description": "A Brunch skeleton for rapid Ember development. Including Ember install scripts, generators, and Ember.vim support.",
  "author": {
    "name": "Jeremy Mack",
    "email": "@mutewinter",
    "url": "http://twitter.com/mutewinter"
  },
  "version": "1.0.0",
  "homepage": "https://github.com/mutewinter/tapas-with-ember",
  "repository": {
    "type": "git",
    "url": "https://github.com/mutewinter/tapas-with-ember.git"
  },
  "engines": {
    "node": ">= 0.8.0"
  },
  "scripts": {
    "start": "cake server",
    "test": "./node_modules/.bin/testem"
  },
  "dependencies": {
    "brunch": "=1.7.13",
    "coffee-script": "~1.6.3",
    "javascript-brunch": "~1.7.1",
    "coffee-script-brunch": "~1.7.3",
    "css-brunch": "~1.7.0",
    "stylus-brunch": "~1.7.0",
    "uglify-js-brunch": "~1.7.6",
    "clean-css-brunch": "~1.7.1",
    "auto-reload-brunch": "~1.7.1",
    "ember-handlebars-brunch": "https://github.com/mutewinter/ember-handlebars-brunch/tarball/master",
    "semver": "~2.2.1",
    "adm-zip": "~0.4.3",
    "github": "~0.1.12",
    "digest-brunch": "~1.0.4",
    "canned": "~0.2.2"
  },
  "devDependencies": {
    "qunitjs": "*",
    "testem": "~0.5.15"
  }
}
@mutewinter

This comment has been minimized.

Show comment
Hide comment
@mutewinter

mutewinter Feb 11, 2014

Owner

Was worried it might still be too old. I'll look into it later and try to get it working with canary. Thanks for reporting this @millisami

Owner

mutewinter commented Feb 11, 2014

Was worried it might still be too old. I'll look into it later and try to get it working with canary. Thanks for reporting this @millisami

@mutewinter

This comment has been minimized.

Show comment
Hide comment
@mutewinter

mutewinter Feb 11, 2014

Owner

Oh yeah, and you're also deleting your node_modules/ember-handlebars-brunch and doing npm install, right?

Owner

mutewinter commented Feb 11, 2014

Oh yeah, and you're also deleting your node_modules/ember-handlebars-brunch and doing npm install, right?

@millisami

This comment has been minimized.

Show comment
Hide comment
@millisami

millisami Feb 12, 2014

Yeah @mutewinter I did dat too.
I want to use this badly!!

Yeah @mutewinter I did dat too.
I want to use this badly!!

@millisami

This comment has been minimized.

Show comment
Hide comment
@millisami

millisami Feb 12, 2014

@mutewinter Any update on this? I want to try out the query-params-new feature badly!!

@mutewinter Any update on this? I want to try out the query-params-new feature badly!!

@mutewinter

This comment has been minimized.

Show comment
Hide comment
@mutewinter

mutewinter Feb 12, 2014

Owner

@millisami I think I found your problem. Running cake handlebars:install gave you too new of a version of Handlebars. Just back up to the version in the master tapas-with-ember repo and it should work. I've got it running on my local box.

Also, I'm using my fork of ember-handlebars-brunch to make this work.

Owner

mutewinter commented Feb 12, 2014

@millisami I think I found your problem. Running cake handlebars:install gave you too new of a version of Handlebars. Just back up to the version in the master tapas-with-ember repo and it should work. I've got it running on my local box.

Also, I'm using my fork of ember-handlebars-brunch to make this work.

@millisami

This comment has been minimized.

Show comment
Hide comment
@millisami

millisami Feb 13, 2014

@mutewinter But in the master branch, the handlebars is still the 1.0.0 only. So how does it work?

I followed up your way, the error is not coming but the handlebars loaded version is still 1.0.0.
Can you whip up and put a sample repo?

@mutewinter But in the master branch, the handlebars is still the 1.0.0 only. So how does it work?

I followed up your way, the error is not coming but the handlebars loaded version is still 1.0.0.
Can you whip up and put a sample repo?

@mutewinter

This comment has been minimized.

Show comment
Hide comment
@mutewinter

mutewinter Feb 14, 2014

Owner

@millisami got it!

Use @gcollazo's fork of ember-handlebars-brunch and Handlebars 1.3.0 from http://handlebarsjs.com in vendor/scripts/handlebars.js (not via cake handlebars:install).

"ember-handlebars-brunch": "https://github.com/gcollazo/ember-handlebars-brunch/tarball/master",

Here's a screenshot of it working:

screen shot 2014-02-14 at 11 54 09 am

app/controllers/index.coffee

module.exports = App.IndexController = Ember.Controller.extend
  queryParams: ['test']

app/templates/index.hbs

<h2>Welcome to Tapas with Ember</h2>
<p>
  You are running in the {{env.name}} environment.
  {{link-to 'index' (test test='one')}}
</p>
<ul>
  {{#each item in content}}
    <li>{{item}}</li>
  {{/each}}
</ul>
Owner

mutewinter commented Feb 14, 2014

@millisami got it!

Use @gcollazo's fork of ember-handlebars-brunch and Handlebars 1.3.0 from http://handlebarsjs.com in vendor/scripts/handlebars.js (not via cake handlebars:install).

"ember-handlebars-brunch": "https://github.com/gcollazo/ember-handlebars-brunch/tarball/master",

Here's a screenshot of it working:

screen shot 2014-02-14 at 11 54 09 am

app/controllers/index.coffee

module.exports = App.IndexController = Ember.Controller.extend
  queryParams: ['test']

app/templates/index.hbs

<h2>Welcome to Tapas with Ember</h2>
<p>
  You are running in the {{env.name}} environment.
  {{link-to 'index' (test test='one')}}
</p>
<ul>
  {{#each item in content}}
    <li>{{item}}</li>
  {{/each}}
</ul>
@millisami

This comment has been minimized.

Show comment
Hide comment
@millisami

millisami Feb 15, 2014

Thanks @mutewinter , it did.
Can you explain what was the issue and will it be merged into this repo?

Thanks @mutewinter , it did.
Can you explain what was the issue and will it be merged into this repo?

@mutewinter

This comment has been minimized.

Show comment
Hide comment
@mutewinter

mutewinter Feb 16, 2014

Owner

@millisami the problem is that cake handlebars:install uses the latest master of Handlebars, which is 2.0 alpha. That has breaking changes. The second problem is that the template compiler didn't have sub-expression support until 1.2.0. I'm going to switch to bower for managing Handlebars, and I hope to have that setup soon.

Owner

mutewinter commented Feb 16, 2014

@millisami the problem is that cake handlebars:install uses the latest master of Handlebars, which is 2.0 alpha. That has breaking changes. The second problem is that the template compiler didn't have sub-expression support until 1.2.0. I'm going to switch to bower for managing Handlebars, and I hope to have that setup soon.

@mutewinter mutewinter closed this Feb 16, 2014

@mutewinter

This comment has been minimized.

Show comment
Hide comment
@mutewinter

mutewinter Feb 16, 2014

Owner

Just pushed Bower management of Handlebars to master 7e13277.

Owner

mutewinter commented Feb 16, 2014

Just pushed Bower management of Handlebars to master 7e13277.

@millisami

This comment has been minimized.

Show comment
Hide comment
@millisami

millisami Mar 1, 2014

@mutewinter , I think it would be better if the package.json file also specify the bower as the dependency in the skeleton itself!
Noticed this when deploying to Heroku.

@mutewinter , I think it would be better if the package.json file also specify the bower as the dependency in the skeleton itself!
Noticed this when deploying to Heroku.

@mutewinter

This comment has been minimized.

Show comment
Hide comment
@mutewinter

mutewinter Mar 1, 2014

Owner

Good call. I'll add it

Owner

mutewinter commented Mar 1, 2014

Good call. I'll add it

mutewinter added a commit that referenced this issue Mar 1, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment