React.js Vercel Deploy Error Message | Error: No Output Directory named "build" found after the Build completed

Hi All, I have been getting the following errors from Vercel when deploying the app. How do i rectify this issue? Tried this method on stackoverflow, but still stuck.

Error: No Output Directory named "dist" found after the Build completed. You can configure the Output Directory in your Project Settings.

STATIC_BUILD_NO_OUT_DIR: No Output Directory named "dist" found after the Build completed. You can configure the Output Directory in your Project Settings.

package.json

"scripts": {
    "dev": "vite",
    "build": "vite build",
    "lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
    "preview": "vite preview"
  },

vite.config.js

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  build: { manifest: true, outDir: './dist'},
  base:  '/',
  root: './src',
  plugins: [react()],
})

layout of the folder:

Vercel settings


seems like your output directory is at “question” here, perhaps share your “project structure” that might help!!

hey, @bappyasif thanks for reverting. I decided to restructure my frontend (deployed on Vercel) and backend (deployed on Render) files and commit them into separate git repositories. So far the deploying was smoothly but I gotta fix my database connection (Postgres)

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.