Troubleshoot common static site deployment problems.
If you run into any issues with your static site, check the following for tips and solutions for common errors.
If the deployment of your site completes without error, but you see a 403 error when trying to visit the site in your browser, here are a few things to check:
File permissions control who can:
Each file and directory has its own set of file permissions, shown as a 3-digit number. Each number indicates the permission level for each category (read, write, and execute) shown above.
If the deployment of your site completes without error, but you see a 404 error when trying to visit the site in your browser, there are a few things to check:
The Build command tells our system how to assemble your site, and the Publish directory is the subdirectory where the finished site files live, relative to the root of your repository. It’s crucial to fill out these fields correctly if your site depends on a build step. This will ensure your site is built and served as you intend. If the Build command is left blank, the system may indicate the deployment is complete, but it will only upload the unbuilt contents of your repository.
If you enter a build command for your site, you can select the Node version to use. If you select the incorrect version, the deployment will fail, and there will be an error in the deployment logs that indicates a different Node.js version is needed, similar to this:
Check your static site’s settings, change the Node version as needed, and manually deploy the site again (click Deploy now on the Deployments page).
If an issue occurs with the build command or configuration file, you may see the following error:
Error: Unable to determine package manager
This error usually occurs due to an incorrect build command or a missing or incorrectly configured package.json file. Here are a couple of things to check: