gildas-lormeau / SingleFileZ

Web Extension to save a faithful copy of an entire web page in a self-extracting ZIP file
GNU Affero General Public License v3.0
1.82k stars 140 forks source link

TypeError or something (using CLI) #142

Closed piegamesde closed 1 year ago

piegamesde commented 1 year ago

single-filez-cli/single-filez --block-scripts=false --block-audios=false --max-resource-size-enabled --max-resource-size=200 --remove-alternative-images=false --remove-alternative-medias=false http://web.archive.org/web/20220512150500/https://twitter.com/fka_tabs/status/1524767300800425986 $out

Evaluation failed: TypeError: Cannot read properties of undefined (reading 'type')
    at new Blob (http://web.archive.org/_static/js/wombat.js?v=UHAOicsW:21:75448)
    at Ln (<anonymous>:1:75510)
    at <anonymous>:1:75407
    at Array.map (<anonymous>)
    at <anonymous>:1:75362
    at Array.map (<anonymous>)
    at zn (<anonymous>:1:75321)
    at In (<anonymous>:1:74588)
    at async e.getPageData (<anonymous>:1:371042)
    at async pptr://__puppeteer_evaluation_script__:3:21 URL: http://web.archive.org/web/20220512150500/https://twitter.com/fka_tabs/status/1524767300800425986
Stack: Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'type')
    at new Blob (http://web.archive.org/_static/js/wombat.js?v=UHAOicsW:21:75448)
    at Ln (<anonymous>:1:75510)
    at <anonymous>:1:75407
    at Array.map (<anonymous>)
    at <anonymous>:1:75362
    at Array.map (<anonymous>)
    at zn (<anonymous>:1:75321)
    at In (<anonymous>:1:74588)
    at async e.getPageData (<anonymous>:1:371042)
    at async pptr://__puppeteer_evaluation_script__:3:21
    at ExecutionContext._ExecutionContext_evaluate (single-filez-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:229:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (single-filez-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:107:16)
    at async getPageData (single-filez-cli/back-ends/puppeteer.js:139:20)
    at async exports.getPageData (single-filez-cli/back-ends/puppeteer.js:51:10)
    at async capturePage (single-filez-cli/single-file-cli-api.js:238:20)
    at async runNextTask (single-filez-cli/single-file-cli-api.js:155:20)
    at async Promise.all (index 0)
    at async capture (single-filez-cli/single-file-cli-api.js:125:2)
    at async run (single-filez-cli/single-filez:57:2)
gildas-lormeau commented 1 year ago

Thank you. There were some conflicts between http://web.archive.org/_static/js/wombat.js (i.e. a script from the page) and the code of single-filez-cli. I was able to circumvent them and fix the issue. The fix is available in the version 1.0.31 I've just published on NPM.