hamlbars icon indicating copy to clipboard operation
hamlbars copied to clipboard

Hamlbars causes an illegal nesting error

Open LandonSchropp opened this issue 9 years ago • 4 comments

Here's what I've done:

  1. I added Hamlbars to the Gemfile: gem 'hamlbars', '~> 2.1'. We're already using handlebars_assets.
  2. I created a new file file at app/assets/javascripts/test.js.hbs.hamlbars.
  3. I added this to that file: %p Testing.

When I open the project in my browser, I get the following error:

throw Error("Haml::SyntaxError: Illegal nesting: nesting within plain text is illegal.\n  (in /Users/landonschropp/Development/quve/app/assets/javascripts/test.js.hbs.hamlbars)")

I've also tried removing everything from the test file and I still get the same error.

In case there's a conflict, these are all of the asset gems we're using:

gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'haml-rails'
gem 'handlebars_assets'
gem 'gon'
gem 'autoprefixer-rails'
gem 'roadie'
gem 'redcarpet'
gem 'hamlbars', '~> 2.1'

gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'videojs_rails'
gem 'pickadate-rails', "~> 1.2.0"
gem 'datejs-rails'

LandonSchropp avatar Jul 11 '14 17:07 LandonSchropp

+1

KurtPreston avatar Jul 24 '14 16:07 KurtPreston

@LandonSchropp @KurtPreston

I was having the same problem but renaming the file to just test.hamlbars did the trick.

hopsor avatar Jul 25 '14 10:07 hopsor

@hopsor If you just do .hamlbars, how do you compile the raw Handlebars output?

LandonSchropp avatar Jul 25 '14 17:07 LandonSchropp

Are there any news on this issue?

hendrikstier avatar May 05 '15 14:05 hendrikstier