Single blog page is not showing

Please fill out as many of the following questions as possible so we can help you promptly! If you don’t know how to answer or it does not apply, feel free to remove it or leave it blank.

Builder content link

Builder public api key
fff8e6fa6fbc4f6abf4fb93c03e661f1

Detailed steps to reproduce the bug
I have created a custom component for single blog page. It was working before but from yesterday it is not working.

Screenshots or video link

Code stack you are integrating Builder with
NextJS, swell

Can you share a code snippet? This might have to do with mispelling/bad registering.

For registering component

import dynamic from "next/dynamic";
import { Builder } from "@builder.io/react";

const SingleBlog = dynamic(async () => {
  return  (await import('./SingleBlog')).default
})

Builder.registerComponent(SingleBlog, {
  name:'Single Blog'
})

Get data from builder

const getBuilderData = async (slug: string | string[] | undefined) => {
  return await builder
    .get(model, {
      query: {
        'data.slug': slug,
      },
      fields:
      'id,data.description1,data.videoText,data.videoUrl,data.description2,data.heading2,data.description3,data.tags,data.heading,data.coverImage,data.category,data.date,data.slug,data.relatedBlogs',
    })
    .promise()
    .then((data) => {
      return data
    })
}

const SingleBlog = () => {
  const [singleData, setSingleData] = useState<IsingleBlog>()
  const [relatedBlogs, setRelatedBlogs] = useState<IrelatedBlogs[]>()

  const router = useRouter()

  useEffect(() => {
    getBuilderData(router.query.slug)
    .then((data) =>{
        setSingleData(data);
        if(data && data.data && data.data.relatedBlogs) {
          setRelatedBlogs(data.data.relatedBlogs)
        }
      }
    )
    .catch((error) => console.error(error))
  }, [])

What error and response are you getting? And can you send a screenshot on how the code use to look when you were working on this?

From what I can see, Single Blog is not painting the data over a nor return a div to render.

@anupama.sharmaa I checked your page and it looks like you have your single blog sections working now? Let me know if this is still an issue that needs further investigation!

I’d also be interested to know how you were able to figure out and fix the issue!