Hi,
I am working on a NextJS implementation of a WP using NextJS on the front end.
Contrary to the posts I have been reading, the dynamic route /music of my site is taking precedence over the /music/page.tsx static I have in the src directory.
I can see the content of my remote WP page, not the custom code that my static route is supposed to do.
The most interesting part is that, once in every 10 builds (average), it does what is supposed to happen (build from the static route).
The static route also uses the remote site's content, but it comes from a diff API endpoint which delivers a different kind of data (not a WP page data) which is processed differently.
My page code contains this:
export default async function Music() { const res = await fetch(`${process.env.WP_API}/releases`); const releases = await res.json(); // then the content above is processed down the page to output the page's custom content.I have my next.confg.js set like this:
const nextConfig = { output: 'export',Expected behaviour: the static route should always be build. Current behaviour: most of the time, the generated page's content comes from the remote site's graphQL content.
Deployment URL or Custom Domain:Environment (local, preview, production): productionProject Framework: nextJS (latest)Build Settings: Framework Preset: Build Command (if not default): npm run build Output Directory (if not default): out Install Command (if not default): Node/Runtime Version: 20.17.0Package Manager:Relevant Packages: