← All Articles
DevelopmentLegionEdge TeamMarch 18, 20245 min read

Troubleshooting common issues

A quick reference guide for resolving the most frequent errors and deployment issues.

TroubleshootingDevelopmentSupport

Troubleshooting common issues

Even with the best tools, you might encounter issues during development or deployment. This guide covers some common problems and how to solve them.

Build Fails

If your application fails to build on LegionEdge, follow these steps:

  1. Check the Build Logs: The first place to look is the deployment logs in your dashboard. Look for red error messages.
  2. Missing Dependencies: Ensure all required packages are listed in your package.json under dependencies or devDependencies.
  3. Local vs. Remote: Does it build locally? Run your build command (npm run build) on your machine. If it fails there, fix the local issue first.
  4. Environment Variables: Verify that all necessary environment variables have been added in the dashboard. Missing API keys or database URLs often cause build failures.

404 Pages

If navigating to a specific route returns a 404 error:

  1. Check Routing: Ensure the file defining the route exists and is named correctly according to your framework's conventions (e.g., pages/about.js or app/about/page.js).
  2. Dynamic Routes: If you're using dynamic routing (like [slug]), confirm that the static generation functions (generateStaticParams or getStaticPaths) are returning the correct parameters.
  3. Build Output: Sometimes, static files aren't generated correctly. Review your build configuration.

Environment Variable Errors

If your application crashes because it can't find an environment variable:

  1. Prefixes: Some frameworks require specific prefixes to expose variables to the browser (e.g., NEXT_PUBLIC_, VITE_, REACT_APP_). Ensure you're using the correct prefix if the variable needs to be accessed client-side.
  2. Restart Development Server: If you added a variable to your local .env file, you usually need to restart your development server for it to take effect.

Cross-Origin Resource Sharing (CORS)

If your API requests from the browser are blocked:

  1. API Configuration: The API server you are calling needs to be configured to accept requests from your application's domain.
  2. Proxying: During development, you can often proxy requests through your local server to avoid CORS issues.

Still Stuck?

If you've tried these steps and are still experiencing issues:

  • Search our documentation.
  • Check community forums or Stack Overflow.
  • Reach out to LegionEdge support.

Contributors

L

LegionEdge Team

Support