-
We have a baseUrl like "/sample" and a root level catch all [...slug].js that uses SSG with fallback=true. During build time, we build 18 blogs, and the static files get placed in the root of /.next/server/pages/ (even though we have a basePath of /sample). Then during runtime, when we hit a blog directly ([...slug].js), the fallback=true file that is statically generated is put into /.next/server/pages/sample/. So our build time files are placed in one directory, while our fallback=true runtime files are placed in the context of the baseUrl (sample). The application works, but the two directories have potentially duplicate files (the only thing different is the configuration of the path within for the json file). Has anyone else seen this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Funny enough, right after I posted this I was testing (return { paths, fallback: 'unstable_blocking' };) and the unstable_blocking fixed it. |
Beta Was this translation helpful? Give feedback.
Funny enough, right after I posted this I was testing (return { paths, fallback: 'unstable_blocking' };) and the unstable_blocking fixed it.
So what looks like what was happening is that with fallback=true, it was building the initial static file under the basePath and the potentially build a secondary file under the root of the completed HTML. This solved our issue because sometimes that secondary complete HTML never happened.