jekyll-lunr-js-search
jekyll-lunr-js-search copied to clipboard
nesting of 101 is too deep
The creation of the lunr index fails with the following error: nesting of 101 is too deep
$ jekyll b
Configuration file: /www/dev-jekyll/_config.yml
Source: /www/dev-jekyll
Destination: /www/dev-jekyll/_site
Generating...
Lunr: Creating search index...
jekyll 2.5.3 | Error: nesting of 101 is too deep
Ruby version: 1.9.3p484 Jekyll version: 2.5.3 jekyll-lunr-js-search version: 0.2.1 (installed via gem)
+1
+1. Yep, we're seeing this too. It seems to happen when we put a link to a particularly long URL in a Markdown file.
Generating...
Lunr: Creating search index...
/opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/json-1.8.2/lib/json/common.rb:155:in `parse': nesting of 101 is too deep (JSON::NestingError)
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/json-1.8.2/lib/json/common.rb:155:in `parse'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-lunr-js-search-0.2.1/lib/jekyll_lunr_js_search/javascript.rb:10:in `to_hash'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-lunr-js-search-0.2.1/lib/jekyll_lunr_js_search/indexer.rb:88:in `generate'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:280:in `block in generate'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:279:in `each'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:279:in `generate'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:50:in `process'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/command.rb:28:in `process_site'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:56:in `build'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:34:in `process'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/serve.rb:26:in `block (2 levels) in init_with_program'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
from /opt/boxen/rbenv/versions/2.1.2/bin/jekyll:23:in `load'
from /opt/boxen/rbenv/versions/2.1.2/bin/jekyll:23:in `<main>'
Change: sudo vim $(bundle show jekyll-lunr-js-search)/lib/jekyll_lunr_js_search/javascript.rb to JSON.parse(to_json, {:max_nesting => false}).
And: sudo vim $(bundle show jekyll-lunr-js-search)/lib/jekyll_lunr_js_search/indexer.rb to File.open(filepath, "w") { |f| f.write(JSON.dump(total)) } where total is written.
@mrquincle this worked for me!
this worked for me too.. Thanks
:+1: Awesome fix. How can we get this merged in?
oh no...
attempted to deploy blog to heroku... I ended up with this..

Now I'm stuck.. please help!
temporary workaround: (Gemfile)
gem 'jekyll-lunr-js-search', :git => "https://github.com/masterfix/jekyll-lunr-js-search.git"
+1
+1
+1
Came Across this error in Jekyll 3.0, except it was a Nesting size of 151. The above repo didn't work but the fix was the same, so I forked it and created another repo. Put this in the Gemfile if you're getting the nesting error (temp workaround ofc):
gem 'jekyll-lunr-js-search', :git => "https://github.com/InsidiousMind/jekyll-lunr-js-search.git"
same error here
:+1:
+1