Replies: 1 comment
-
Facing same issue. Works well if I remove encodeURI |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have detailed most of the issue in my StackOverflow question: https://stackoverflow.com/questions/69609567/next-js-encodeuricomponent-doesnt-work-with-in-getstaticpaths. I'm going to be repeating most of the same details here.
I am trying to iterate through an array of food objects and create static pages for each one based on its title. This works for most of the foods, but if the food title contains a
/
, then navigating to the page (such as the "Nice strawberry/kiwis dessert" page) will throw a 404.In the home page, I encode the URL when I create the
Link
and then in thegetStaticPaths
function, I create thepaths
using the same encoded link. However, it doesn't seem to work when deployed.The page does work locally when running
npm run dev
, but it seems that in the actual output build there are issues. Is there something I can do to allow paths with encoded slashes to work? Any help would be appreciated, thanks!Home page
Food page
Beta Was this translation helpful? Give feedback.
All reactions