here is a picture of static directory
This website runs properly locally but then when I deployed it to heroku, it would load halfway and then go blank, the chrome console pops up errors I haven't still been able to find solutions to (It was built using next.js, django and postgresql). I'm new to all of this, please I need help?
favourndubuisi.herokuapp.com
CodePudding user response:
It looks like you need to configure static directories in your Django setup as Django is trying to process the _next
directories.
See the error reported on one of the missing chunks.
http://favourndubuisi.herokuapp.com/_next/static/chunks/821.ff7693b6a698a8d3.js
Page not found (404)
Request Method: GET
Request URL: http://favourndubuisi.herokuapp.com/_next/static/chunks/821.ff7693b6a698a8d3.js
Using the URLconf defined in config.urls, Django tried these URL patterns, in this order:
admin/
about/
projects/
technologies/
contact/
^static/(?P<path>.*)$
^media/(?P<path>.*)$
The current path, _next/static/chunks/821.ff7693b6a698a8d3.js, didn’t match any of these.
You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
However, this chunk works http://favourndubuisi.herokuapp.com/static/_next/static/chunks/pages/index-77a9eb1106a2340d.js
which means you have a static directory, I would place all items under static
from _next
under your Django static
directory including the chunks folder.
CodePudding user response:
I managed to solve it by deleting and recreating the static files