PrismicNextLink not linking to document inside a slice repeatable field

If you add a Link field to a slice, it doesn't work for linking to Documents. It just returns an empty href.

I verified on a fresh install too.

Linking to images and web does work.

Anyone else having this issue?

{slice.items.map((item, index) => (
  <PrismicNextLink key={index} field={item.link}>
    Link
  </PrismicNextLink>
))}

Seems to be in all fields actually. Strange

Ok so it's definitely to do with the new App Router. Just going back to /pages - too many issues still to try and make it work.

Ok, so I'm loosing the plot, I found the issue.

Instead of importing the Prismic client from the route of the project, I was importing the client from the package. :man_facepalming:

Wrong: import { createClient } from "@/prismicio/client";
Correct: import { createClient } from "@/prismicio";

1 Like

can u please detail your solution as i do have the same problem. and inside a slice you don't need to import createClient