Build error: Deploy directory 'frontend/dist' does not exist

When building I am getting this error:

11:35:16 AM: Section completed: deploying
11:35:16 AM: ​
11:35:16 AM: Configuration error                                           
11:35:16 AM: ────────────────────────────────────────────────────────────────
11:35:16 AM: ​
11:35:16 AM:   Error message
11:35:16 AM:   Deploy did not succeed: Deploy directory 'frontend/dist' does not exist

But this is my setting in `vite.config.ts`:

{
  build: {
    outDir: 'frontend/dist',
    emptyOutDir: true,
  }
}

So what is wrong?

So I finally got things working with these settings:

  • Base directory: frontend
  • Package directory: Not set
  • Publish directory: Not set

I have tried MANY other settings. Most logical to me would have seemed:

  • Base directory: Not set (= root)
  • Package directory: Not set
  • Publish directory: frontend/dist

This seems slightly magical to me. How should I have known?

So I finally got things working with these settings:

  • Base directory: frontend
  • Package directory: Not set
  • Publish directory: Not set

I have tried MANY other settings. Most logical to me would have seemed:

  • Base directory: Not set (= root)
  • Package directory: Not set
  • Publish directory: frontend/dist

This seems slightly magical to me. How should I have known?

So the issue was a wrong build command setting: ‘npm i -f’ instead of ‘npm run build`. After this the sensible values for base directory (empty) and publish directory (frontend/dist) worked.