I deployed a serverless NEXTJS application that implements SSR ( server-side rendering ), and it has some dynamic routes.
It works fine until I press on a link that links to a page that had a dynamic route… for example branches/[id]
It sends a request to get the static js file or the chunk js file needed to serve the page … but instead of getting the file directly because it’s a static js file, it goes through my _app!
static file URL example
https://example.app/_next/static/chunks/pages/branches/%5Bid%5D-91768ff65c2a79ad38ee.js
correct me if I am wrong, all static files should be served from functions directly anything else should go through my _app, right?
environment:
node version: 14.15.1
next version: 10.0.9
and I am using new “@netlify/plugin-nextjs” plugin to deploy
PLEASE HELPPPPP
Hi @Doaa-Ismael ,
Welcome to the forum!
I think the dynamic routes are getting routed trough Netlify functions maybe that part is missbehaving.
You can see trough other post to see if something rings a bell for you, here are all questions for next-on-netlify.
If you are really new to this I would suggest to go trough @cassidoo’s excelent article, there are some really good links and resources.
You can the check setup instructions for @netlify/plugin-nextjs and make sure your setup looks right.
Lastly, if all looks great i would suggest to inspect the generated Deploy by downloading it locally by:
- Go to the (Netlify App) [https://app.netlify.com]
- Navigate to your Project
- Navigate to the Deploy section
- Select your last successful deploy
- Next to the TimeStamp, there’s an icon for download
This would basically helps you see what the version is generated and hosted on Netlify.
Lastly, you can check the issues for next-on-netlify.
1 Like