disqus / disqus-react

A React component for Disqus
MIT License
365 stars 46 forks source link

Got a bunch of error when using disquss with Nextjs also got a CORS #127

Open rahXephonz opened 2 years ago

rahXephonz commented 2 years ago

Describe the bug

Got a bunch of error when using disquss with especially it was blocked by CORS. please see the image

Screenshots

image

Specifications:

Additional context

import React from "react";
import styled from "@emotion/styled";
import { DiscussionEmbed } from "disqus-react";

type BlogCommentsProps = {
  title: string;
  slug: string;
};

type DisqusConfig = {
  url: string;
  identifier: string;
  title: string;
};

const CommentsWrapper = styled.div`
  max-width: 100%;
  margin: 40px 0px;

  @media screen and (max-width: 653px) {
    padding: 0 15px;
  }
`;

const BlogComments: React.FC<BlogCommentsProps> = (props) => {
  // your disquss shortname from https://disqus.com/admin/
  const disqusShortname = process.env.NEXT_PUBLIC_DISQUS_SHORTNAME;

  const disqusConfig = {
    // your site that was deployed on server in here
    url: `https://rizkyy.space/blog/${props.slug}`,
    identifier: props.title,
    title: props.title,
  };

  return (
    <CommentsWrapper>
      <DiscussionEmbed
        shortname={disqusShortname}
        config={disqusConfig as DisqusConfig}
      />
    </CommentsWrapper>
  );
};

export default BlogComments;

Any solutions about this?

tterb commented 2 years ago

@ioofy These console errors appear to be caused by failing request for the sponsored links that Disqus utilizes for ad-supported publishers. My best guess is that they are likely failing due of some kind of adblock extension.

rahXephonz commented 2 years ago

@ioofy These console errors appear to be caused by failing request for the sponsored links that Disqus utilizes for ad-supported publishers. My best guess is that they are likely failing due of some kind of adblock extension.

oh i see, ok thanks for replying.

Andresdamelio commented 2 years ago

@ioofy These console errors appear to be caused by failing request for the sponsored links that Disqus utilizes for ad-supported publishers. My best guess is that they are likely failing due of some kind of adblock extension.

@tterb I have the same problem, but I don't have any active extension, testing from the phone I get the same thing. And it only happens in chrome, in safari it loads correctly.