Nuxt route resolve

Im trying to customize my routes on my about-me page.

        modules: [
            // https://go.nuxtjs.dev/pwa
            "@nuxtjs/pwa",
            "nuxt-webfontloader",
            "@nuxtjs/svg",
            [
              "@nuxtjs/prismic",
              {
                endpoint: "https://xxx.cdn.prismic.io/api/v2",
                apiOptions: {
                  routes: [
                    {
                      type: "page",
                      path: "/:uid",
                    },
                    {
                      type: "about-type",
                      path: "/about-me/about-type",
                    },
                   {
                      type: "about-type2",
                      path: "/about-me/about-type2",
                    },

               }
]

But the url's i get looks like this "/about". It gets cut at the hyphen. It should be /about-me/about-type2
Why do they get cut at the hyphen?

Hello @victorthevictoriousv

Thanks for posting this question to us.

To use route-resolver, you need Slicemachine activated on their repository. Can you please send me the URL of your repository?

I am looking forward to hearing from you back.

Thanks,

Priyanka

Hey :smiley:
This one you mean?
https://tecomatic.cdn.prismic.io/api/v2

Hi Victor,

This is a known issue with the Route Resolver and hyphens that the team has started to fix last week.

We are tracking the issue and will update everyone below when the fix is pushed:

Thanks.

1 Like

If you plan to have the 'about-type' as a UID you can overcome the hyphen issue on 'about-me' by creating a relationship back to the parent 'about-me' document and using a resolver.

For example, your uid page 'about type' has a relationship field 'link_to_about' that you link to 'about-me' in Prismic.

Then you can use the resolver like so:

{
  type: "about-type",
  path: "/:about/:uid",
  resolvers: {
    about: "link_to_about"
  }
}
3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.