Skip to content

Wrong theme with loading=lazy #1152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
natario1 opened this issue Feb 26, 2023 · 2 comments
Closed

Wrong theme with loading=lazy #1152

natario1 opened this issue Feb 26, 2023 · 2 comments

Comments

@natario1
Copy link

Hi,
I'm using the react component as follows:

function Comments({ className = '' }) {
  const theme = useGiscusTheme()
  return <Giscus
      ...
      theme={theme}
      loading='lazy'
  />
}

If I scroll down and load the comments, then changing the theme works correctly. But if the theme changes before giscus has a chance to load, it won't pick it up and the following error is logged:

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://giscus.app') does not match the recipient window's origin ('http://localhost:3002').

Am I doing something wrong?

@laymonage
Copy link
Member

Could you update to the latest version (v2.2.8) and see if this issue still exists?

@natario1
Copy link
Author

v2.2.8 fixed the issue. Thank you @laymonage 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants