You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, next export generates files assuming absolute paths. This is problematic when the static site is pushed to a sub-folder, e.g. Github Pages.
For example, if I push my my-project/out folder to a gh-pages branch, then access it at https://user.github.io/my-project/, the page is looking for assets at /_next/..., for example href="/_next/a3c4359f-2b55-4680-b981-dfddcf84cea4/page/index.js"
To solve the problem, I think we want to be able to specify a custom path e.g. /my-project, so then it would look for assets in /my-project/_next/...
The text was updated successfully, but these errors were encountered:
You already can do that using assetPrefix configuration. Just add that key to your next.config.js and set /my-project if you are running on production, that way when running next build you will have /my-project/_next/... and in development you will use /_next/....
Currently,
next export
generates files assuming absolute paths. This is problematic when the static site is pushed to a sub-folder, e.g. Github Pages.For example, if I push my
my-project/out
folder to agh-pages
branch, then access it athttps://user.github.io/my-project/
, the page is looking for assets at/_next/...
, for examplehref="/_next/a3c4359f-2b55-4680-b981-dfddcf84cea4/page/index.js"
To solve the problem, I think we want to be able to specify a custom path e.g.
/my-project
, so then it would look for assets in/my-project/_next/...
The text was updated successfully, but these errors were encountered: