← All Articles
DevelopmentLegionEdge Team•March 18, 2024•5 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:
- Check the Build Logs: The first place to look is the deployment logs in your dashboard. Look for red error messages.
- Missing Dependencies: Ensure all required packages are listed in your
package.jsonunderdependenciesordevDependencies. - 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. - 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:
- Check Routing: Ensure the file defining the route exists and is named correctly according to your framework's conventions (e.g.,
pages/about.jsorapp/about/page.js). - Dynamic Routes: If you're using dynamic routing (like
[slug]), confirm that the static generation functions (generateStaticParamsorgetStaticPaths) are returning the correct parameters. - 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:
- 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. - Restart Development Server: If you added a variable to your local
.envfile, 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:
- API Configuration: The API server you are calling needs to be configured to accept requests from your application's domain.
- 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