jekyll-lunr-js-search icon indicating copy to clipboard operation
jekyll-lunr-js-search copied to clipboard

nesting of 101 is too deep

Open masterfix opened this issue 10 years ago • 15 comments
trafficstars

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)

masterfix avatar Jan 20 '15 16:01 masterfix

+1

chauncey-garrett avatar Jan 20 '15 18:01 chauncey-garrett

+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>'

ecowden avatar Jan 26 '15 16:01 ecowden

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 avatar Feb 03 '15 23:02 mrquincle

@mrquincle this worked for me!

justinrummel avatar Feb 15 '15 19:02 justinrummel

this worked for me too.. Thanks

ferrlin avatar Mar 16 '15 15:03 ferrlin

:+1: Awesome fix. How can we get this merged in?

alexbaldwin avatar Mar 20 '15 18:03 alexbaldwin

oh no...

attempted to deploy blog to heroku... I ended up with this..

screen shot 2015-03-27 at 1 34 18 am

Now I'm stuck.. please help!

ferrlin avatar Mar 26 '15 17:03 ferrlin

temporary workaround: (Gemfile)

gem 'jekyll-lunr-js-search', :git => "https://github.com/masterfix/jekyll-lunr-js-search.git"

ferrlin avatar Mar 28 '15 21:03 ferrlin

+1

alexbaldwin avatar Mar 31 '15 23:03 alexbaldwin

+1

jewellsean avatar Apr 26 '15 02:04 jewellsean

+1

dstroot avatar Jun 14 '15 15:06 dstroot

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"

insipx avatar Nov 17 '15 23:11 insipx

same error here

zzjin avatar Feb 02 '16 07:02 zzjin

:+1:

ickc avatar Feb 06 '16 00:02 ickc

+1

dstroot avatar Feb 23 '16 04:02 dstroot