Netlify doesn't server static files

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

correct me if I am wrong, all static files should be served from functions directly anything else should go through my _app, right?

node version: 14.15.1
next version: 10.0.9

and I am using new “@netlify/plugin-nextjs” plugin to deploy


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:

  1. Go to the (Netlify App) []
  2. Navigate to your Project
  3. Navigate to the Deploy section
  4. Select your last successful deploy
  5. 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