page.mainImage() throws error 'Cannot read property 'imageinfo' of undefined'
See original GitHub issueI’m getting the same error like in Issue #51. However, I’m using the english wiki page and the page has an infobox with the File
prefix.
wiki()
.page("FC Copenhagen")
.then(page => page.mainImage())
.then(console.log)
.catch(e => console.error(e));
RawImage:
{ pageid: 28199557,
ns: 6,
title: 'File:FC København.svg',
imagerepository: 'local',
imageinfo: [ [Object] ] },
...
imageinfo:
{ url: 'https://upload.wikimedia.org/wikipedia/en/9/93/FC_K%C3%B8benhavn.svg',
descriptionurl: 'https://en.wikipedia.org/wiki/File:FC_K%C3%B8benhavn.svg',
descriptionshorturl: 'https://en.wikipedia.org/w/index.php?curid=28199557' }
Error:
TypeError: Cannot read property 'imageinfo' of undefined
at node_modules/wikijs/dist/page.js:1:4213
at process._tickCallback (internal/process/next_tick.js:109:7)
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Cannot read property 'image' of undefined angular 6
When trying to get the details it renders to the dom but it gives an undefined error. here is an image ...
Read more >TypeError: Cannot read property 'image' of undefined · Issue #5
By using the example code that you have given is throwing error. TypeError: Cannot read property 'image' of undefined.
Read more >Cannot read properties of undefined (reading 'url') when trying ...
I get Cannot read properties of undefined (reading 'url') undefined error when i pass this in src section.primary.content_image.url or ...
Read more >Cannot read properties of undefined (reading ... - Reddit
The error i'm getting is "cannot read properties of undefined: reading profilepicFilepath" (screenshots attached). please correct my mistake ...
Read more >How to use the wikijs.default function in wikijs - Snyk
catch((err) => { const noImageErr = 'Cannot read property \'imageinfo\' of undefined';. Was this helpful?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in v4.0.0
Thanks, fixed.