Site was showing 404 errors and "Page not found" on deployed Netlify site. Resources were not loading correctly.
The netlify.toml configuration was conflicting with the @netlify/plugin-nextjs plugin:
- ❌ Specified
publish = ".next"directory manually - ❌ Added custom redirects that conflicted with Next.js routing
- ❌ Headers configuration was interfering with deployment
[build]
command = "npm run build"
[[plugins]]
package = "@netlify/plugin-nextjs"
[build.environment]
NODE_VERSION = "20.18.0"The @netlify/plugin-nextjs plugin automatically handles:
- ✅ Correct publish directory and output structure
- ✅ Next.js redirects and rewrites
- ✅ Serverless functions for dynamic routes
- ✅ Static asset optimization
- ✅ ISR (Incremental Static Regeneration) if needed
Manual configuration was causing conflicts!
- Removed:
publish = ".next" - Removed: Custom redirect rules
- Removed: Custom header configurations (can add back later if needed)
- Added:
.netlifyto.gitignore
Since the configuration has been fixed and pushed to GitHub, Netlify will automatically deploy the changes if you have auto-deploy enabled.
Or manually trigger:
- Go to your Netlify dashboard
- Click "Deploys" tab
- Click "Trigger deploy" → "Deploy site"
To ensure the new configuration is used:
- Go to Site settings → Build & deploy
- Click "Clear cache and retry deploy"
Make sure you have set:
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id
After deployment completes (2-3 minutes):
- ✅ Homepage loads at your Netlify URL
- ✅ All static pages work
- ✅ Navigation functions correctly
- ✅ Assets (images, CSS, JS) load properly
- ✅ No 404 errors
Netlify build log should show:
✓ Compiled successfully
✓ Linting and checking validity of types
✓ Generating static pages (7/7)
Route (app) Size First Load JS
┌ ○ / 54.6 kB 465 kB
├ ○ /_not-found 880 B 89.9 kB
├ ○ /manifest.webmanifest 0 B 0 B
├ ○ /robots.txt 0 B 0 B
└ ○ /sitemap.xml 0 B 0 B
Plugin "@netlify/plugin-nextjs" ran successfully
- Check build logs - Look for any errors during the plugin execution
- Verify Node version - Should be using 20.18.0
- Clear browser cache - Hard refresh (Cmd+Shift+R or Ctrl+Shift+R)
- Check Functions tab - Next.js plugin should have created functions
- Check that
NEXT_PUBLIC_WALLETCONNECT_PROJECT_IDis set - Verify
@netlify/plugin-nextjsis installed (it is: v5.13.5) - Review build logs for specific errors
You can add them back to next.config.mjs instead of netlify.toml:
headers: async () => {
return [
{
source: '/:path*',
headers: [
{ key: 'X-Frame-Options', value: 'SAMEORIGIN' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
// ... more headers
]
}
];
}(These are already in your next.config.mjs)
Add to next.config.js not netlify.toml:
redirects: async () => {
return [
{
source: '/old-path',
destination: '/new-path',
permanent: true,
}
];
}After deployment:
- Visit your Netlify URL
- Check homepage loads (/)
- Check manifest loads (/manifest.webmanifest)
- Check sitemap loads (/sitemap.xml)
- Check robots.txt loads (/robots.txt)
- Test wallet connection button
- Check browser console for errors
- Verify all images load correctly
✅ Site is live and accessible
✅ No 404 errors on main pages
✅ Static assets load from CDN
✅ Navigation works correctly
✅ Web3 functionality initializes
Repository: https://github.com/charlie-818/Vaulto-Swap
Latest Commit: b00ce37 - Fix Netlify deployment configuration
Status: Ready to deploy ✅
The site should now deploy correctly on Netlify!