Issue: Styles and Images Not Loading After Netlify Deployment

Issue Description:

I am encountering an issue with deploying my website on Netlify. Despite successful deployment, the styles and images are not loading properly. The project structure includes a dist folder where CSS files and images are located. However, after deployment, it seems like Netlify is unable to locate these assets.

Steps Taken:

  1. Verified that the assets are present in the dist folder locally.
  2. Checked the build process locally to ensure that assets are properly generated.
  3. Reviewed the build logs on Netlify for any errors or warnings related to asset loading.

Expected Outcome:

I expect the deployed website on Netlify to render with all styles and images properly loaded, as it does in my local environment.

Additional Information:

Any assistance or insights on resolving this issue would be greatly appreciated. Thank you!

This has nothing to do with Netlify as serving dist locally (e.g. npx serve dist) shows the same problem.

It is the build command in the package.json

 "build": "vite build --base=/apartment-renovation-new-jersey/",

When you deploy on Netlify, the site sits at the domain root /. If you remove the --base option, you should find the site works as expected.

1 Like

I have deleted apartment-renovation-new-jersey/ and it works. Thank you so much:)