CPanel Issue: NextJS Static Export Doesnt Load, missing JS Chunks, CSS & SVG

89 Views Asked by At

Update: Extra information, I used VSCode Live server to host the static files locally, and I ve found it works. So it could be an issue with how CPanel deals with static files?

I am having a problem with the NextJS static site generation. Chunks, SVG files & subpages are not loading because of both 404 not found errors and MIME type. The build process is error free though.

This export has worked before in the past, so im not sure what happened since then. I'm using CPanel to host static files.

You can see the live site with errors in the console at: https://quincegr.com

You'll see that some of the CSS and HTML is working, but the JS isn't, also the links (which are the images below) lead to a default 404 not found page.

The github is public too: https://github.com/spikethea/portfolio

I used 'next build' to produce the build folder, then placed the contents into public_html (CPanel root folder for hosting files) Succesful NextJS Static Build

The live site errors

Here is the next.config file too, nextJS config

1

There are 1 best solutions below

0
SpikeThea On

Fixed my Issue. Possibly to do with having a subdomain. For anyone who has this issue and is using CPanel with NextJS SSG:

  1. Go into your public_html director and click the settings in the top right of the screen.

enter image description here

  1. Select Home Directory enter image description here