decktape
decktape copied to clipboard
Not working on an InspireJS slidedeck: Error [TypeError]: Cannot read properties of null (reading 'style')
Trying to download this slidedeck that I made: https://torno1.matirosero.art, but it works with https://inspirejs.org
Getting the following error:
Error [TypeError]: Cannot read properties of null (reading 'style') at evaluate (evaluate at Inspire.configure (file:///PATH/decktape/node_modules/decktape/plugins/inspire.js:19:22), <anonymous>:0:38) at #evaluate (file:///PATH/decktape/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:383:19) at async ExecutionContext.evaluate (file:///PATH/decktape/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:270:16) at async IsolatedWorld.evaluate (file:///PATH/decktape/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/IsolatedWorld.js:96:16) at async CdpFrame.evaluate (file:///PATH/decktape/node_modules/puppeteer-core/lib/esm/puppeteer/api/Frame.js:336:20) at async CdpPage.evaluate (file:///PATH/decktape/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page.js:801:20) at async configurePlugin (file:///PATH/decktape/node_modules/decktape/decktape.js:365:5)
Thanks for the report. It seems in your case there is no timer element, which is assumed to be present there:
https://github.com/astefanutti/decktape/blame/0e0a75bcf05960e5d7ecf74313755c251134fe0f/plugins/inspire.js#L19
I assume the timer plugin is not mandatory, so an easy fix would be to check if the timer element is present or not: https://github.com/LeaVerou/inspire.js/blob/50910c3e720d3a92e3c960916a6d78cb2a5bd8b8/plugins/timer/plugin.js
I'll look into it ASAP, but I'd be very happy to accept a PR :)