Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

lunr search_within_pages regressed in v4.25.0 - Liquid syntax error: Expected end_of_string but found id in assets/js/lunr/lunr-store.js #4808

Closed
brackendawson opened this issue Apr 27, 2024 · 4 comments

Comments

@brackendawson
Copy link

What happened?

  • Minimal Mistakes version: 4.25.0
  • Ruby gem or remote theme version: remote theme
  • Jekyll version: 3.9.3 (via githib-pages@228, it's also broken after updating to 3.9.5 via github-pages 231)
  • Git repository URL: winchesterchess/winchesterchess.github.io@7f9eb8f (use this commit)
  • Hosted on GitHub Pages (if yes provide URL to site): https://winchesterchess.uk/
  • Operating system: macOS 12.7.4

Since the release of v4.25.0 my site no longer builds. I was not constraining the minimal-mistakes version in my _config.yml so I had picked up 4.25 automatically. I was getting the following locally:

% bundle exec jekyll serve
Configuration file: /Users/alan/src/github.com/winchesterchess/winchesterchess.github.io/_config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
            Source: /Users/alan/src/github.com/winchesterchess/winchesterchess.github.io
       Destination: /Users/alan/src/github.com/winchesterchess/winchesterchess.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
      Remote Theme: Using theme mmistakes/minimal-mistakes
       Jekyll Feed: Generating feed for posts
   GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
  Liquid Exception: Liquid syntax error (line 46): Expected end_of_string but found id in assets/js/lunr/lunr-store.js
jekyll 3.9.5 | Error:  Liquid syntax error (line 46): Expected end_of_string but found id
/usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/parser.rb:16:in `consume': Liquid syntax error (line 46): Expected end_of_string but found id (Liquid::SyntaxError)
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/filters.rb:369:in `parse_condition'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/filters.rb:200:in `where_exp'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/strainer.rb:56:in `invoke'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/context.rb:86:in `invoke'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/variable.rb:84:in `block in render'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/variable.rb:82:in `each'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/variable.rb:82:in `inject'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/variable.rb:82:in `render'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/tags/assign.rb:26:in `render'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/block_body.rb:103:in `render_node_to_output'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/block_body.rb:91:in `render'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/tags/if.rb:46:in `block (2 levels) in render'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/tags/if.rb:44:in `each'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/tags/if.rb:44:in `block in render'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/context.rb:123:in `stack'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/tags/if.rb:43:in `render'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/block_body.rb:103:in `render_node_to_output'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/block_body.rb:82:in `render'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/template.rb:206:in `block in render'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/template.rb:240:in `with_profiling'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/template.rb:205:in `render'
        from /usr/local/lib/ruby/gems/3.2.0/gems/liquid-4.0.4/lib/liquid/template.rb:218:in `render!'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/liquid_renderer/file.rb:30:in `block (2 levels) in render!'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/liquid_renderer/file.rb:42:in `measure_bytes'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/liquid_renderer/file.rb:29:in `block in render!'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/liquid_renderer/file.rb:49:in `measure_time'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/liquid_renderer/file.rb:28:in `render!'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/renderer.rb:126:in `render_liquid'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/renderer.rb:79:in `render_document'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/renderer.rb:62:in `run'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/site.rb:479:in `render_regenerated'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/site.rb:472:in `block in render_pages'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/site.rb:471:in `each'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/site.rb:471:in `render_pages'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/site.rb:192:in `render'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/site.rb:71:in `process'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/command.rb:28:in `process_site'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/commands/build.rb:65:in `build'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/commands/build.rb:36:in `process'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/commands/serve.rb:93:in `block in start'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/commands/serve.rb:93:in `each'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/commands/serve.rb:93:in `start'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
        from /usr/local/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
        from /usr/local/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
        from /usr/local/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
        from /usr/local/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
        from /usr/local/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-3.9.5/exe/jekyll:15:in `<top (required)>'
        from /usr/local/lib/ruby/gems/3.2.0/bin/jekyll:25:in `load'
        from /usr/local/lib/ruby/gems/3.2.0/bin/jekyll:25:in `<top (required)>'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/lib/bundler/cli/exec.rb:58:in `load'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/lib/bundler/cli/exec.rb:58:in `kernel_load'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/lib/bundler/cli/exec.rb:23:in `run'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/lib/bundler/cli.rb:492:in `exec'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/lib/bundler/cli.rb:34:in `dispatch'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/lib/bundler/cli.rb:28:in `start'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/exe/bundle:37:in `block in <top (required)>'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.17/exe/bundle:29:in `<top (required)>'
        from /usr/local/opt/ruby/bin/bundle:25:in `load'
        from /usr/local/opt/ruby/bin/bundle:25:in `<main>'

Expected behavior

I expected the site to build, as it did before the 4.25.0 release.

Steps to reproduce the behavior

bundle exec jekyll serve

Other

Updating the github-pages gem to version 231 (latest) yields the same issue.

I found two changes which independanly fix this:

  1. Rolling back to v4.24.0 by setting remote_theme : "mmistakes/minimal-mistakes@4.24.0" in the _config.yml
  2. Setting lunr.search_within_pages to false.

So it looks relagted to some change in the lunr search but only when indexing pages. I tried to re-create this on a fresh install of minimal-mistakes on a blank jekyll site but search_within_pages works there, so probably something to do with my pages. I've tried deleting all my pages and layouts, but still no luck.

@iBug

This comment was marked as outdated.

@iBug
Copy link
Collaborator

iBug commented Apr 27, 2024

I think I've got it in 7ea8510. Can you try building your site with remote_theme: mmistakes/minimal-mistakes@7ea8510d4f554e670bfd2c3c30ed3a2fc3a39323 and see if it's fixed? My local clone from your given commit is now building without error.

@brackendawson
Copy link
Author

Yes, fixed, thank you for the amazingly fast turnaround!

@iBug
Copy link
Collaborator

iBug commented Apr 27, 2024

Fixed as of 4.25.1.

@iBug iBug closed this as completed Apr 27, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants