Liquid error: wrong number of arguments

I’m getting Liquid errors about wrong number of arguments when I try to jekyll build after my latest updates to the template files. I’ve gone through the updates a number of times, but can’t see anything problematic. I’m also not a Ruby or Liquid expert so I’m having trouble interpreting the error message.

Liquid Exception: Liquid error (line 19): wrong number of arguments (1 for 2) in /_layouts/standard.html

Any help would be much appreciated. You can see the CI build log here and repo is on GitHub

(I found the following thread, but it’s unrelated to my issue - I’m using no plugins.)

You could try removing Gemfile.lock, and then run “bundle install” again. That might fix it. I had this problem the other day but assumed it was due to something else I was doing. I eventually fixed it. It was a Bundler gem issue, not necessarily something in my theme.

1 Like

Thanks Tom, it looks like it is to do with bundler. Recreating the lock file hasn’t directly resolved the issue, but has got me looking on the right track. Just in time too - couldn’t face another review of my template files :slight_smile:

I’ve got problems with installing the right version of rb-fsevent. Even after a clean install of Jekyll 3.5.0, there are dependency issues with listen. It looks like I’m not the only one, but surprised there aren’t more reports.

I’ve now uninstalled all gems and installed jekyll and bundler from scratch. I’m still getting the issue. This is consistent with the CI build log above. I’ve now run it with --trace too and get an additional error which might help.

Liquid Exception: Liquid error (line 19): wrong number of arguments (1 for 2) in /_layouts/standard.html bundler: failed to load command: jekyll (/home/runner/.rbenv/versions/2.2.2/bin/jekyll)

Still confused… :confused:

if you remove that one layout (or replace it contents with something simple) does it still give an error?

Sorry, I wish I could be more help, but I wasn’t paying close attention when I was troubleshooting this same problem on my machine. I did a number of things – gem clean, gem uninstall jekyll (uninstalled all jekyll versions, then re-installed), updated bundler, updated rubygems, made ruby directory (usr, not system) writeable, restarted computer). I was changing a jekyll theme I’d written from gem-based to hard-coded and thought this error was related somehow to that, but later realized it must have something to do with bundler and jekyll 3.5.0. you might see if you have some other gem dependency (like github-pages) that is requiring some older version of a gem or jekyll that is causing conflicts. sorry I can’t be more help. you might try filing an issue in the Jekyllrb repo.

1 Like

Are prepending your Jekyll commands with bundle exec? If not give that a go as you likely have dependency conflicts from having multiple versions installed and this will get around that by using the versions specified in your Gemfile.lock

bundle exec jekyll serve

bundle exec jekyll build
1 Like

I think I figured it out. I poked around your template files for a few minutes and found a missing colon in line 19 of _includes/cv_structured_data.html (included in _layouts/standard.html). Inserting a colon after append fixes it.

I’m not sure why Liquid reports the error in the layout file. I tried some tests on my own and found that it always reports filter errors in the layout file but will correctly report other errors (such as an unclosed if tag) in the include file.

1 Like

Big thanks to @tomjohnson1492, @rdyar & @mmistakes, but I owe @chromatical a drink (or two) :wink:

The error was reported on line 19 of a standard.html, but turned out to be on line 19 of an include which features on line 93 of standard.html (and is neither the first, nor last include on that template). I’m not surprised it wasn’t the first thing I thought of…

@chromatical Is it worth reporting the lack of filter error reporting at include level as a bug?

@gvdm I’m mostly a teetotaller, but I’ll take a hot mug of English Breakfast any day! :grin:

I looked through both the Jekyll and Liquid issues and couldn’t find anything related to this, so I think it’s worth reporting. I’ll go ahead and open an issue.

@gvdm Here’s the issue I created.

1 Like

Top man! :wink: :coffee:

1 Like