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.

page.mainImage() throws error 'Cannot read property 'imageinfo' of undefined'

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dijscommented, Aug 15, 2017

Fixed in v4.0.0

0reactions
dijscommented, Oct 16, 2017

Thanks, fixed.

Read more comments on GitHub >

github_iconTop 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 >

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