alexspeller / emblem-rails

Emblem.js integration with rails asset pipeline
MIT License
34 stars 21 forks source link

Pre-compilation issue? #33

Open clov3r opened 9 years ago

clov3r commented 9 years ago

[Probably related to #32, but I'm using the advised

gem "emblem-source", github: "machty/emblem.js"
gem "barber-emblem", github: "simcha/barber-emblem"
``` ]

I'm getting a weird problem here. I'm totally new to ember, and rails as well, but trying to dive in.

At the moment, I'm getting `Uncaught SyntaxError: Unexpected identifier` on all my js templates. When I look at them in chrome's web inspector, these files have content like the following:

Ember.TEMPLATES["application"] = Ember.Handlebars.template([object Object]);

original file: templates/application.js.emblem (compiles to the above)

nav.navbar.navbar-inverse.navbar-fixed-top .container .navbar-header button.navbar-toggle.collapsed type="button" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar" span.sr-only Toggle navigation span.icon-bar span.icon-bar span.icon-bar a.navbar-brand href="#" Home

navbar.collapse.navbar-collapse

  ul.nav.navbar-nav
    li.active
      a href="#Family" Family
    li
      a href="#Feed" Feed
    li
      a href="#Library" Library

.container
main = outlet

footer


Which looks like some tool in the chain isn't printing out the object properly.

DEBUG: ------------------------------- DEBUG: Ember : 1.9.1 DEBUG: Ember Data : 1.0.0-beta.14.1 DEBUG: Handlebars : 2.0.0 DEBUG: jQuery : 1.11.1 DEBUG: -------------------------------


I'm using  ember-rails v 0.16.1, emblem-rails v0.2.2, emblem-source v0.3.18, coffee-rails v4.0.1 and coffee-script v2.3.0.

Not sure if this is an emblem-rails bug, but I figured I'd start here.

Let me know if I can provide more info to track this down.
timtonk commented 9 years ago

Have the same problem. It worked with ember 1.9.2pre and forked versions of emblem-source and barber-emblem. Then I updated Ember to 1.10 by

rails g ember:install

and removed those forks from the Gemfile. Now I see

Ember.TEMPLATES["application"] = Ember.Handlebars.template([object Object]);

I suppose a rollback to 1.9.2+pre will solve this problem, but I'd like to have ember 1.10.0.

UPD: Oh, one more thing. Debug record for handlebars is missed after update! Now it looks like:

DEBUG: -------------------------------
DEBUG: Ember      : 1.10.0
DEBUG: Ember Data : 1.0.0-beta.14.1
DEBUG: jQuery     : 2.1.1
DEBUG: -------------------------------

UPD2: Just found that there is no ember 1.9.2pre on the build server. I'm confused.