# Route Resolver Error

**URL:** <https://community.prismic.io/t/route-resolver-error/16089>\
**Category:** Developing with Prismic\
**Tags:** svelte, link-route-resolver\
**Created:** [June 7, 2024, 8:27pm UTC](https://community.prismic.io/t/route-resolver-error/16089 "2024-06-07T20:27:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mayerbrandingfireclo](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mayerbrandingfireclo](https://community.prismic.io/u/mayerbrandingfireclo)\
**Post date:** [June 7, 2024, 8:27pm UTC](https://community.prismic.io/t/route-resolver-error/16089/1 "2024-06-07T20:27:55Z")

</div>

## Describe your question/issue in detail

Hello, thank you for your help. I am building a SvelteKit based site and having trouble understanding how to properly config the routes.

I have a menu with one level deep, lets say:

home  
contact us

- write us
- directory

The "directory" and "write us" page have a relationship of the type category called "contact-us"

I noticed that I can access this pages either way:

[https://mysite.com/directory](https://mysite.com/directory)  
or  
[https://mysite.com/contact-us/directory](https://mysite.com/contact-us/directory)

However, I want /contact-us/directory to be the only way to access this page.

--

My current file structure:

[[preview==preview]]

- [category]  
-- [uid]  
---+page.svelte  
---+page.server.js  
-[uid]  
--+page.svelte  
--+page.server.js

My prismicio file config:

```auto
const routes = [
	{
		type: 'page',
		uid: 'home',
		path: '/'
	},
	{
		type: 'page',
		path: '/:uid',
	},
];

```

After reading the documentation, [Routes — Prismic Docs](https://prismic.io/docs/route-resolver#route-resolve), I have tried a few ways of adding the route with a resolver :

```auto
	{
		type: 'page',
		path: '/:category/:uid',
              resolvers:{
                 category: 'category'
              }
	},

```

But I get error 500.

Console error:

```auto
  response: {
[vite:dev] type: 'Link resolver error',
[vite:dev] message: '[Link resolver error] Invalid resolver category\n' +
[vite:dev] 'It must be a content relationship linked to one and only one custom typ'
[vite:dev] }
[vite:dev] }

```

I would really appreciate your help to help me understand this. I think the relationship is linked to only one type, so it is kinda confusing.

Thanks again!

### Impacted feature

Link resolver

### What steps have you taken to resolve this issue already?

Read docs. Modifying routes const

### Errors

Invalid resolver category

### Your Role

Freelancer developer

### Hosting provider

local

---

<div class="post-metadata">

**Author:** ![mayerbrandingfireclo](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mayerbrandingfireclo](https://community.prismic.io/u/mayerbrandingfireclo)\
**Post date:** [June 14, 2024, 11:44pm UTC](https://community.prismic.io/t/route-resolver-error/16089/3 "2024-06-14T23:44:55Z")

</div>

Figured this out. Thanks.

Within the docs, resolvers: {category: 'category'} makes it confusing.

resolvers: { dynamicpathname: 'relationship-API-id' } is how I finally understood.

---

<div class="post-metadata">

**Author:** ![meevo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/meevo/32/8451_2.png) [@meevo](https://community.prismic.io/u/meevo)\
**Post date:** [December 10, 2024, 10:17am UTC](https://community.prismic.io/t/route-resolver-error/16089/5 "2024-12-10T10:17:29Z")

</div>

would you mind sharing a quick example... i am stuck on the same problem but cant quite figure it out what the right logic is

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [December 10, 2024, 10:38am UTC](https://community.prismic.io/t/route-resolver-error/16089/6 "2024-12-10T10:38:27Z")

</div>

Hi @meevo ,

Welcome to the community 🙂

If you share your route resolver and your API IDs for the fields and their custom type IDs we can help you build this.
