@prismicio/next@1.x using old `useRouter` hook

I'm having problems migrating to Next@13.x because when I import @prismicio/next I get the following error


After looking into the code of your next integration it seems that the new version is using the old useRouter hook that comes from next/router, but it should be using the hooks from next/navigation (Next documentation).

Hello @klynger

Thanks for reaching out to us.

Thanks for reaching out,

Next.js 13 is not yet fully supported with Prismic, but you can check this thread that might be helpful.

Best,
Priyanka

Thank you for the answer, Priyanka. I understand that the support is not 100%, but the thing is that in the Prismic documentation it says that we should use the 1.x version of @prismicio/next to get the support for Next@13, but it uses the things that wil break in Next@13.x. It seems like a bug and I didn't find a post about it anywhere.

Hello @klynger

Sorry for the late response. I was on vacation.

I need more information:

  1. At what step do you get the error?
  2. Are you using nextJs 13 with Slice Machine?

I find some resources it might be helpful.
You can learn more about the decision here:

  1. feat!: support Next 13, drop support for Next 12 by angeloashmore · Pull Request #48 · prismicio/prismic-next · GitHub
  2. Next.js 13 and Prismic Slice Machine - YouTube

You can open a ticket in our issue tracker with more details.

I am looking forward to hearing back from you.

Thanks,
Priyanka

Hey, here’s some more info:

  • v1 supports Next.js 13 when using its traditional pages directory. @prismicio/next does not yet support Next.js 13's beta app directory.

Thanks,
Priyanka

1 Like