1

I have a multi-lingual application that I use exportPathMap but I want to transition to getStaticProps and getStaticPaths. My structure looks like so:

pages/[language]/[app-slug].js

However, [app-slug].js could be any of 20 different applications with unrelated code...

After reading caveats I thought, with pre-defining the getStaticPaths, I would be able to do:

-[language]
--[app1].js
--[app2].js
...

But it throws You cannot use different slug names for the same dynamic path ('app1' !== 'app2')

Is there any way to dynamically load the react app code based on path, or to have multiple dynamic files in one repo? (all static paths are known)

This similar answer to use query values won't work for my case, SEO and bundle size are top priorities.

Kevin Danikowski
  • 4,620
  • 6
  • 41
  • 75
  • I did find https://github.com/vercel/next.js/issues/9130 which has them saying they don't plan to support this functionality. However, I think there could potentially be a solution with dynamically loading the react code if any one knows of one – Kevin Danikowski Oct 05 '21 at 22:45

0 Answers0