Since the site is configured with basePath: '/advisor-calculator' for GitHub Pages, you need to handle this for local preview.
This serves the files and lets you access at the correct path:
# From the project root
cd out
python3 -m http.server 8000Then open in your browser:
http://localhost:8000/en.html
Or directly access any language:
- English: http://localhost:8000/en.html
- Chinese: http://localhost:8000/zh.html
- Japanese: http://localhost:8000/ja.html
- Spanish: http://localhost:8000/es.html
- French: http://localhost:8000/fr.html
To stop: Press Ctrl+C in the terminal
# Serve with simulated subdirectory structure
npx serve outThen open:
http://localhost:3000/en.html
If you want to test at root path (http://localhost:3000/):
const nextConfig = {
output: 'export',
// basePath: '/advisor-calculator', // Comment this out temporarily
trailingSlash: false,
images: {
unoptimized: true,
},
// ...
};npm run buildnpx serve outhttp://localhost:3000/
basePath before deploying to GitHub Pages!
Fastest way (recommended):
cd out
python3 -m http.server 8000Then visit: http://localhost:8000/en.html
GitHub Pages serves your site at:
https://username.github.io/repo-name/
The basePath: '/advisor-calculator' tells Next.js to generate all links/assets with this prefix, so:
- CSS:
/advisor-calculator/_next/static/... - JS:
/advisor-calculator/_next/static/... - Links:
/advisor-calculator/en.html
Without it, GitHub Pages would look for files at the root and get 404 errors.