TypeError: Cannot read properties of undefined (reading 'dict')
See original GitHub issueHi there!
First off, thanks for making decktape, it’s a great tool! 😄
I’ve run into an issue lately, where my Pandoc ➡️ reveal.js presentation (that renders fine in the browser), fails to convert to PDF using decktape. The error I get is:
Loading page file:///censored/decktape-issue/talk.html ...
Page error: TypeError: Cannot read properties of undefined (reading 'Config')
at file:///censored/decktape-issue/reveal.js/plugin/math/math.js:1:1674
at HTMLScriptElement.o (file:///censored/decktape-issue/reveal.js/plugin/math/math.js:1:1541)
Loading page finished with status: 0
Reveal JS plugin activated
Printing slide #/decktape-is-awesome (3/4) ...
TypeError: Cannot read properties of undefined (reading 'dict')
make: *** [pdf] Error 1
The error is reproducible and I’ve managed to single out the page render using --slides 3
, and if I then open the resulting PDF file, the PDF reader complains about “an error in the page”.
I’ve published a repo to reproduce the error: https://github.com/krisvanrens/decktape-issue
Build using make pdf
The error has something to do with background images I added to decorate my code snippets in the slides. I’ve added CSS to the reveal.js theme that adds a programming language logo to the code box on the slide. It seems the error occurs when I include two code boxes with the same language on a single page, see https://github.com/krisvanrens/decktape-issue/blob/main/talk.md
This renders down to:
<section id="decktape-is-awesome" class="slide level2">
<h2>Decktape is awesome!</h2>
<p>Test 1-2-3</p>
<div class="columns">
<div class="column">
<pre ><code class="rust" data-line-numbers="">// ...
// ...</code><div class="langlogo"><div class="rust numbered-block"></div></div></pre>
</div><div class="column">
<pre ><code class="rust" data-line-numbers="">// ...
// ...</code><div class="langlogo"><div class="rust numbered-block"></div></div></pre>
</div>
</div>
</section>
Which looks fine to me, but decktape doesn’t take it.
I’d like to help fix this issue, but don’t know enough about decktape to know where to start. Any help is appreciated! 🙂
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top GitHub Comments
That’s awesome! It works 😄 Glad to have been of help!
Keep on the great work 👍🏻
Thanks for the swift reply!
Mmmm…my gut feeling says otherwise, but it is a possibility. I’ve had this MathJax error for years, without ever having trouble exporting to PDF before. Even through many updates of reveal.js and decktape. Also, if I take away one of the two columns in the page, the issue is gone. AFAIK, there’s no use of MathJax in the example page whatsoever.
But yes, there is a chance this is a latent bug in MathJax/integration of MathJax triggered by this page.
Let me get back to you! 🙂