Skip to content

Latest commit

 

History

History
81 lines (71 loc) · 3.59 KB

fix_404_issue.md

File metadata and controls

81 lines (71 loc) · 3.59 KB

Plan to Resolve 404 Error on Netlify Deployment

1. Verify @netlify/plugin-nextjs Installation and Configuration

  • Check package.json:
    • Ensure @netlify/plugin-nextjs is listed under "dependencies".
    • Confirm the version (^5.9.4) is compatible with the installed Next.js version (^13.4.24).
  • Review netlify.toml:
    • Confirm the plugin is correctly configured:
      [[plugins]]
        package = "@netlify/plugin-nextjs"
    • Ensure there are no conflicting plugins that might interfere with the Next.js plugin.

2. Inspect the Build Process

  • Local Build Test:
    • Run npm run build locally to ensure the build completes without errors.
    • Verify that the .netlify/functions directory is populated after the build.
  • Netlify Build Logs:
    • Access the Netlify dashboard.
    • Navigate to the specific site deployment logs.
    • Look for any errors or warnings related to the build process or plugin execution.

3. Check .netlify/functions Directory

  • Expected Contents:
    • After a successful build, the .netlify/functions directory should contain the nextjs-server function files.
  • Current Observation:
    • Only .gitkeep is present, indicating that functions were not generated.
  • Action:
    • Ensure that the build process is not skipping function generation.
    • Verify that no errors during the build are preventing function creation.

4. Review next.config.mjs for Potential Conflicts

  • External Packages:
    • The configuration includes serverExternalPackages: ['@solana/web3.js'].
    • Confirm that external packages are not conflicting with Netlify's build process.
  • Webpack Configuration:
    • Ensure that custom webpack settings are compatible with Netlify's serverless functions.
    • Specifically, review the externals added in the webpack configuration.

5. Validate Environment Variables on Netlify

  • Required Variables:
    • SOLANA_RPC_URL
    • OPENSVM_RPC_LIST
    • OPENSVM_RPC_LIST_2
    • NEXT_USE_NETLIFY_EDGE
    • NODE_VERSION
    • NEXT_TELEMETRY_DISABLED
    • NEXT_PRIVATE_TARGET
  • Action:
    • Ensure all environment variables are correctly set in the Netlify dashboard.
    • Verify that there are no typos or missing variables that the build depends on.

6. Update and Install Dependencies

  • Action:
    • Run npm install to ensure all dependencies are up-to-date.
    • Consider deleting node_modules and reinstalling to eliminate potential corruptions:
      rm -rf node_modules
      npm install

7. Re-deploy to Netlify

  • Action:
    • Trigger a fresh deployment on Netlify after ensuring all configurations and dependencies are correct.
    • Monitor the build process for any errors or warnings.

8. Post-deployment Verification

  • Action:
    • Once deployment is complete, access https://opensvm.com to check if the 404 error persists.
    • Use curl or a browser to verify the site's accessibility.

9. Enable Detailed Logging (If Necessary)

  • Action:
    • If the issue persists, enable more verbose logging in Netlify to gather detailed insights.
    • Modify the build command to include debug flags if supported.

10. Consult Netlify Support or Documentation

  • Action:
    • If all else fails, refer to Netlify's official documentation for deploying Next.js applications.
    • Consider reaching out to Netlify support for assistance with persistent deployment issues.