Skip to content

fix(templates): resolve build errors for vercel website deployment#17101

Open
mattmesmer wants to merge 2 commits into
payloadcms:mainfrom
mattmesmer:fix/templates-website-build
Open

fix(templates): resolve build errors for vercel website deployment#17101
mattmesmer wants to merge 2 commits into
payloadcms:mainfrom
mattmesmer:fix/templates-website-build

Conversation

@mattmesmer

@mattmesmer mattmesmer commented Jun 24, 2026

Copy link
Copy Markdown

This PR fixes four build-blocking issues in the Payload Website Starter template (templates/website/) that prevent successful deployment to Vercel. The fixes address invalid Payload 3.x configuration, incorrect build commands, missing type declarations, and a missing dependency.

The payload-website-starter template (deployed via Vercel or locally) contains several issues that cause build failures:

  • Invalid folders collection — Uses non-existent folders: true property in a collection definition
  • Wrong build command — Uses payload build (which doesn't exist in Payload 3.x) instead of next build
  • Missing type declaration — TypeScript cannot resolve @payloadcms/next/css module
  • Incorrect storage configuration — vercelBlobStorage placed at root storage key instead of plugins array (Payload 3.x API change)

Changes Made

All fixes originated from private repo mattmesmer/payload-website-starter

File Change Source Commit
templates/website/src/payload.config.ts Removed invalid folders collection with folders: true 2873a12
templates/website/package.json Changed "build": "payload build" → "build": "next build" 4006679
templates/website/src/types/payload-css.d.ts Added types file and module declaration for @payloadcms/next/css 6759234
templates/website/payload.config.ts Moved vercelBlobStorage from root storage to plugins array e2f3594

Technical Details

  1. Invalid folders collection (payload.config.ts)
// REMOVED:
{
  slug: 'folders',
  folders: true,  // ← Does not exist in Payload 3.x API
  fields: [],
}
  1. Build command (package.json)
    Payload 3.x uses next build directly; payload build command was removed.
// BEFORE:
"build": "payload build"
// AFTER:
"build": "next build"
  1. Type declaration (new file: src/types/payload-css.d.ts)
declare module '@payloadcms/next/css' {
  const content: string
  export default content
}
  1. Storage configuration (payload.config.ts)
// BEFORE (invalid):
storage: {
  vercelBlobStorage: { ... }
}
// AFTER (correct Payload 3.x):
plugins: [
  vercelBlobStorage({
    enabled: true,
    token: process.env.BLOB_READ_WRITE_TOKEN,
  }),
  // ...
]

Before/After

Before: Fails

$ npm run build
> payload build
sh: payload: command not found
# OR
Type error: Cannot find module '@payloadcms/next/css'
# OR
Error: Invalid storage configuration

After: Succeeds

$ npm run build
> next build
# ✓ Compiled successfully
# ✓ Static pages generated
# ✓ Ready for Vercel deployment

Related Issues / Discussions

  • Template deployment failures reported in Vercel template feedback for "Payload Website Starter"
  • Payload 3.x migration — Storage API moved from root storage to plugins array
  • Discord discussion — Community reports of payload build command not found

Review Notes

  • All changes are confined to templates/website/ — no core Payload code modified
  • Fixes are minimal and targeted; no behavioral changes beyond fixing broken builds
  • Type declaration follows existing patterns in the monorepo (e.g., src/types/*.d.ts)
  • No database migrations or schema changes required

Fixes

  • Fixes Vercel template deployment failures for Payload Website Starter
  • Related to Payload 3.x template compatibility

Checklist

  • ✅ PR title follows conventional commits format
  • ✅ Description explains changes for someone unfamiliar with the code
  • ✅ Before/after behavior documented
  • ✅ Related context linked
  • ✅ Review comments added for non-obvious changes
  • ✅ Only template files modified
  • ✅ No breaking changes to core Payload functionality

@mattmesmer mattmesmer changed the title fix(templates/website): resolve build errors for vercel deployment fix(templates): resolve build errors for vercel website deployment Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant