In order to achieve a single dynamic route for handling all requests in this application, I have created a file called [[...slug]].js
. Data loading is managed using getServerSideProps()
, allowing for server-side rendering. Notably, there are no index.js
files present.
While everything functions properly when running locally in development mode, issues arise upon deployment to Vercel. The problem lies in links pointing to /
; specifically, using
<Link href={"/"}>
results in a request for an index.json file from the server, triggering a 404 response and displaying an error page. The reason behind this behavior remains unclear.