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.

Cannot read property 'forumsFollowing' of undefined

See original GitHub issue

Describe the bug

I’m not sure what the root cause of this bug is, but sometimes (often) when I try clicking the button on the Disqus component that opens the Disqus overlay, I get the error Cannot read property 'forumsFollowing' of undefined in my console. At this point nothing happens, but I cannot interact with my page any longer due to the error.

To Reproduce

It’s happening just when the component loads, and I click the button next to the comment count that opens the overlay for my forum.

EDIT On closer investigation, this bug appears to occur as a result of a button I have to load the discussion thread. If the component loads on start, it works fine, but if I have a conditional rendering that causes the discussion thread to only load when I click a button, then loading the overlay creates this bug. The conditional render looks like this:

        if(this.state.displayComments && this.state.disqusConfig) {
            const disqusConfig = this.state.disqusConfig;
            return <DiscussionEmbed shortname={disqusConfig.disqusShortName} config={disqusConfig.config} />;
        }

        return (
            <div className={styles.commentsButton}>
             <Button onClick={() => {this.setState({displayComments: true})}}>Load Comments</Button>
            </div>
        )

EDIT 2 The issue doesn’t seem to be exclusive to the above scenario after all.

Expected behavior

The forum overlay opens without any errors.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tterbcommented, Aug 8, 2019

@DanielW093 We appreciate you bringing this issue to our attention, a fix has been merged and will be deployed shortly.

1reaction
tterbcommented, Aug 6, 2019

@DanielW093 I was able to recreate the issue both with and without having the component behind a button, so I’ll continue looking into this further and try to track down the cause.

Update: It appears that the scope of this issue goes beyond this package and is occurring on many websites that feature Disqus comments. We’re currently working on tracking down the cause but I’ll leave this issue open until we deploy a fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'follow' of undefined
Answer: const whois = require("whois-checker-v2"); async function getList() { var domains = [ "rundeck.compasso.com.br", "c.btg360.com.br", ...
Read more >
Disqus · Issue #324 · sachinchoolur/lightGallery - GitHub
I just can't find the solution and it appears to be how DISQUS is ... TypeError: Cannot read property 'forumsFollowing' of undefined.
Read more >
How to Avoid Getting 'Cannot read property of undefined' in ...
Learn how you can avoid getting the famous 'Cannot read property of undefined' error in JavaScript with the logical OR operator.
Read more >
Cannot read properties of undefined' - JavaScript Debugging
Join Discord https://selftaught-dev.com/join-discord//r/SelfTaughtDev - https://www.reddit.com/r/selftaughtdevGet My Resume Template Free ...
Read more >
React TypeError: Cannot read property function of undefined
... THERE https://codedocu.com/Software/React/Error/React-TypeError_colon_- Cannot - read - property -send_Data_to_Api-of- undefined ?2755ea.
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