question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read properties of undefined (reading 'dict')

See original GitHub issue

Hi 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:closed
  • Created 2 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
krisvanrenscommented, Mar 9, 2022

That’s awesome! It works 😄 Glad to have been of help!

Keep on the great work 👍🏻

1reaction
krisvanrenscommented, Mar 7, 2022

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! 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to assign dict value - "TypeError: Cannot read properties ...
For second user, it throws error saying "TypeError: Cannot read properties of undefined (reading '0')". I understand it returns error as ...
Read more >
TypeError: Cannot read properties of undefined ... - GitHub
Describe the bug I am running pyright on all my files on a work repository and it is crashing with An internal error...
Read more >
Cannot Read Property Length of Undefined in JavaScript
The JavaScript TypeError: Cannot read property 'length' of undefined occurs when the length property is read on an undefined variable.
Read more >
Cannot read properties of undefined (reading 'length') - TrackJS
This error can be thrown for a lot of reasons, as it is incredibly common to reference the length property of string or...
Read more >
Avoiding those dang cannot read property of undefined errors
Uncaught TypeError: Cannot read property 'foo' of undefined. ​ The dreaded error we all hit at some point in JavaScript development.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found