uwdata / living-papers

Authoring tools for scholarly communication. Create interactive web pages or formal research papers from markdown source.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing to build using template with "style is not iterable" error

evamaxfield opened this issue · comments

Hello, I was just trying to use the template for the first time but running into a build error.

OS and Environment:
Ubuntu 22.04.1
Node 16.4.0
npm 8.19.2
pandoc 2.9.2.1
R 4.2.1
Python 3.10.6

Steps to reproduce:

Error:

~/active/personal/living-papers-template-main
❯ npm run build

> @living-papers/article-template@0.0.1 prebuild
> npm run assets


> @living-papers/article-template@0.0.1 assets
> mkdirp build && cp -r assets build


> @living-papers/article-template@0.0.1 build
> lpub -o build --tempDir='.temp' index.md

file:///home/eva/active/personal/living-papers-template-main/node_modules/@living-papers/compiler/src/parse/parse-pandoc-ast.js:452
      const [ {t: align} /*, {t: width} */ ] = style;
                                               ^

TypeError: style is not iterable
    at file:///home/eva/active/personal/living-papers-template-main/node_modules/@living-papers/compiler/src/parse/parse-pandoc-ast.js:452:48
    at Array.map (<anonymous>)
    at PandocASTParser.tableColumnStyles (file:///home/eva/active/personal/living-papers-template-main/node_modules/@living-papers/compiler/src/parse/parse-pandoc-ast.js:451:19)
    at PandocASTParser.parseTable (file:///home/eva/active/personal/living-papers-template-main/node_modules/@living-papers/compiler/src/parse/parse-pandoc-ast.js:398:25)
    at PandocASTParser.parseBlocks (file:///home/eva/active/personal/living-papers-template-main/node_modules/@living-papers/compiler/src/parse/parse-pandoc-ast.js:154:24)
    at file:///home/eva/active/personal/living-papers-template-main/node_modules/@living-papers/compiler/src/parse/parse-pandoc-ast.js:376:29
    at Array.map (<anonymous>)
    at PandocASTParser.parseEnv (file:///home/eva/active/personal/living-papers-template-main/node_modules/@living-papers/compiler/src/parse/parse-pandoc-ast.js:365:30)
    at PandocASTParser.parseDiv (file:///home/eva/active/personal/living-papers-template-main/node_modules/@living-papers/compiler/src/parse/parse-pandoc-ast.js:353:14)
    at PandocASTParser.parseBlocks (file:///home/eva/active/personal/living-papers-template-main/node_modules/@living-papers/compiler/src/parse/parse-pandoc-ast.js:166:24)

Thanks for the issue @evamaxfield! I re-followed the steps from scratch on MacOS / node 16.17.1, and did not run into any issues.

Perhaps more important, I'm using pandoc v2.18. The stack trace you've shared suggests the problem may be due to differences in the Pandoc AST that Living Papers is trying to convert. Can you update pandoc and see if the issue persists?

Update! Thanks for pushing CI. I was able to use those versions and those steps to build the template.

Mentioning pandoc >= 2.18 in the README of the template may be good? On Ubuntu, apt's latest pandoc version is 2.9.2.1, had to install via conda for the latest.

Happy to make a PR for that if you want.

I think it would be lovely if living-papers could check version requirements for external dependencies. Otherwise, more people will probably run into hard-to-debug issues like this.