# PrismicLink and SvelteKit: Missing Href Attribute Issue

**URL:** <https://community.prismic.io/t/prismiclink-and-sveltekit-missing-href-attribute-issue/14017>\
**Category:** Developing with Prismic\
**Tags:** svelte\
**Created:** [September 1, 2023, 2:16pm UTC](https://community.prismic.io/t/prismiclink-and-sveltekit-missing-href-attribute-issue/14017 "2023-09-01T14:16:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![piyush.bansal.design](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@piyush.bansal.design](https://community.prismic.io/u/piyush.bansal.design)\
**Post date:** [September 1, 2023, 2:16pm UTC](https://community.prismic.io/t/prismiclink-and-sveltekit-missing-href-attribute-issue/14017/1 "2023-09-01T14:16:42Z")

</div>

Hello everyone,

I was testing out the integration of Prismic with SvelteKit and noticed something strange. When using the `PrismicLink` component to create internal links(link to document), the `href` attribute is removed from the anchor tag.

Here's an example of the page data I'm using to generate the links:

```js
{
    "navbar": {
        // ...
        "data": {
            "nav_links": [
                {
                    "label": "About",
                    "link": {
                        "id": "ZPHhThIAACEAsFJp",
                        "type": "work_detail",
                        // ...
                        "uid": "1",
                        "link_type": "Document",
                        "isBroken": false
                    }
                },
                {
                    "label": "Contact",
                    "link": {
                        "link_type": "Web",
                        "url": "https://www.yahoo.com"
                    }
                }
            ]
        }
    }
}

```

I'm passing this data to the `PrismicLink` component in an `each` loop like this:

```plaintext
{#each data.navbar.data.nav_links as links}
    <PrismicLink field={links.link}>
        <p>{links.label}</p>
    </PrismicLink>
{/each}

```

However, the rendered output for the internal link is missing the `href` attribute:

```html
<a><p>About</p></a>

```

Can anyone help me understand why this is happening and how to fix it? Thank you!

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [September 4, 2023, 2:25pm UTC](https://community.prismic.io/t/prismiclink-and-sveltekit-missing-href-attribute-issue/14017/3 "2023-09-04T14:25:25Z")

</div>

Hi @piyush.bansal.design,

Thanks for sharing this question. In the JSON that you shared, is there a `navbar.data.nav_links[0].link.url` property? Each `link` object should have a `url` property. If it doesn't, it's possible that you need to define the route structure for your app in the route resolver:

> **[Route Resolver](https://prismic.io/docs/route-resolver)**
>
> Learn what the route resolver is and how to use it in your project.

Let me know if that helps, or if you still have questions.

Sam

---

<div class="post-metadata">

**Author:** ![piyush.bansal.design](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@piyush.bansal.design](https://community.prismic.io/u/piyush.bansal.design)\
**Post date:** [September 10, 2023, 5:29am UTC](https://community.prismic.io/t/prismiclink-and-sveltekit-missing-href-attribute-issue/14017/4 "2023-09-10T05:29:07Z")

</div>

Hi Sam,  
Route resolver was the problem, thank you for pointing it out!
