Thread:Noreplyz/@comment-26084508-20170424185614/@comment-5811199-20170425010559

For Lua modules, a neat trick is to click on the Script error text to find out what the problem is.

Here, it says: attempt to index local 'chapter' (a nil value). This means that you need to add the 'chapter' parameter to your templates.