# Errors since adding a new content type

**URL:** https://community.prismic.io/t/errors-since-adding-a-new-content-type/13080
**Category:** Developing with Prismic
**Created:** [May 10, 2023, 5:54pm UTC](https://community.prismic.io/t/errors-since-adding-a-new-content-type/13080 "2023-05-10T17:54:46Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![willbrettdesign](https://avatars.discourse-cdn.com/v4/letter/w/6de8d8/32.png) [@willbrettdesign](https://community.prismic.io/u/willbrettdesign)
#### Post date: [May 10, 2023, 5:54pm UTC](https://community.prismic.io/t/errors-since-adding-a-new-content-type/13080/1 "2023-05-10T17:54:46Z")

</div>

Hey there,

A similar yet different issue with my code. I promise I have spent ages trying to figure this out before coming here. But alas no result. Hoping someone can help.

I've added a new content type of blog

 ![Screenshot 2023-05-10 at 18.50.46](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/7/73895dd604df51a8fe5968c015f84ae901ef8264.png)

I've then added this to my route resolver:

 ![Screenshot 2023-05-10 at 18.51.47](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/d/dddb69071eb9185ec5f1212e05483599a719773b.png)

and here is the code that is throwing the error:

 ![Screenshot 2023-05-10 at 18.52.28](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/d/d8f5e6af79a2e716d5b71ccbe11900d9fd301724.png)

and lastly the error:

 ![Screenshot 2023-05-10 at 18.52.49](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/0/0ca10281df35b7ee2e5abacc7c17327e73bbd573.png)

I do have a few blogs created as you can see here and they are published and live.

 ![Screenshot 2023-05-10 at 18.53.23](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/d/def02faeaf46aa16fba8ca98b0c013ffc360e149.png)

So I have no idea what the error is for or how to resolve. I can only think either my routes are wrong because I've misunderstood something or my code is wrong.

Hope some one can help me here.

Thanks

---

<div class="post-metadata">

### Author: ![racheal.orukele](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@racheal.orukele](https://community.prismic.io/u/racheal.orukele)
#### Post date: [May 12, 2023, 8:55am UTC](https://community.prismic.io/t/errors-since-adding-a-new-content-type/13080/4 "2023-05-12T08:55:37Z")

</div>

Hello @willbrettdesign,

Thanks for reaching out to us! 🙂

From what I can see, `blog` is your Custom Type name and not your uid value; you can check your repository to see what your uid value is and use that in the URL on your browser like so `/uid-value`, and you should get the right page.

Can you tell me what value you're pointing to on your browser?

Thanks,  
Racheal.

---

<div class="post-metadata">

### Author: ![willbrettdesign](https://avatars.discourse-cdn.com/v4/letter/w/6de8d8/32.png) [@willbrettdesign](https://community.prismic.io/u/willbrettdesign)
#### Post date: [May 12, 2023, 9:07am UTC](https://community.prismic.io/t/errors-since-adding-a-new-content-type/13080/5 "2023-05-12T09:07:03Z")

</div>

Thanks @racheal.orukele ,

I'm try to load a page based on which blog tile is clicked. For example on my home page I have an array of blog tiles. Each has a UID value so when these are clicked it should open a new page using that UID.

image of blogs on homepage:

 ![Screenshot 2023-05-12 at 10.05.01](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/2/2a948083269c6dd45e374a1654bdb5c6adc6446f.jpeg)

Image of url once one of those blog tiles is pressed

 ![Screenshot 2023-05-12 at 10.05.22](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/9/95de3c466e21eb002ce51a486f78c8efb8690e37.png)

I'm pretty sure the URL is correct here as the blog I pressed' UID is = 1.

So I have no idea why it's throwing an error.

---

<div class="post-metadata">

### Author: ![racheal.orukele](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@racheal.orukele](https://community.prismic.io/u/racheal.orukele)
#### Post date: [May 12, 2023, 11:36am UTC](https://community.prismic.io/t/errors-since-adding-a-new-content-type/13080/6 "2023-05-12T11:36:57Z")

</div>

Hey @willbrettdesign,

Yeah, you're pointing to the correct UID value on the browser.

Can you share a code snippet of the code throwing this error?

You can send it via DM if you prefer.

---

<div class="post-metadata">

### Author: ![willbrettdesign](https://avatars.discourse-cdn.com/v4/letter/w/6de8d8/32.png) [@willbrettdesign](https://community.prismic.io/u/willbrettdesign)
#### Post date: [May 12, 2023, 1:06pm UTC](https://community.prismic.io/t/errors-since-adding-a-new-content-type/13080/7 "2023-05-12T13:06:43Z")

</div>

Hey @racheal.orukele

Here is the entire code for the [uid].js page which I believe is throwing the code:

```auto
import { CreateClient, createClient } from "@prismicio/client"

const BlogPage = () => { //***Add the props to pass from the bottom of this file
    return <></>
};

export default BlogPage;

export async function getServerSideProps(ctx) {
    //create client to connect with prismic 
    const client = createClient();
    //get links by UID
    const blog = await client.getByUID('blog', ctx.params.uid, {
       
        // fetchLinks:['blog.uid', 'blog.title', 'blog.content', 'blog.category', 'blog.timetoread', 'blog.blogimage, blog.author, author.authorname', 'author.avatar', 'blog.releasedate']
    });
    console.log(blog);
    return{
        //return the properties
        props: {
            //properties to pass
            
        }
    }
}

```

---

<div class="post-metadata">

### Author: ![racheal.orukele](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@racheal.orukele](https://community.prismic.io/u/racheal.orukele)
#### Post date: [May 12, 2023, 1:36pm UTC](https://community.prismic.io/t/errors-since-adding-a-new-content-type/13080/8 "2023-05-12T13:36:12Z")

</div>

Hello @willbrettdesign,

You're importing `createClient` from `"@prismicio/client";` and not connecting the client to your Prismic API endpoint. To connect the client to your API, do this:

- ` const client = createClient(sm.apiEndpoint);`

Or you can import the client from `import { createClient } from "../prismicio";`

Let me know if this works.

Thanks,  
Racheal.

---

<div class="post-metadata">

### Author: ![willbrettdesign](https://avatars.discourse-cdn.com/v4/letter/w/6de8d8/32.png) [@willbrettdesign](https://community.prismic.io/u/willbrettdesign)
#### Post date: [May 12, 2023, 1:40pm UTC](https://community.prismic.io/t/errors-since-adding-a-new-content-type/13080/9 "2023-05-12T13:40:53Z")

</div>

Oh rookie error! I did this before and caught it, no idea how I managed it this time.

Thanks so much @racheal.orukele for your help here. Definitely should have caught this one myself but really pleased you were able to solve it!

I suppose it doesn't help that VSC autocompletes the createclient to the wrong one each time.

Thanks again!

---

<div class="post-metadata">

### Author: ![racheal.orukele](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@racheal.orukele](https://community.prismic.io/u/racheal.orukele)
#### Post date: [May 12, 2023, 1:46pm UTC](https://community.prismic.io/t/errors-since-adding-a-new-content-type/13080/10 "2023-05-12T13:46:46Z")

</div>

No worries, @willbrettdesign 🙂 I'm glad everything works fine. Let us know if you have any other questions.
