Repository navigation
Description
Description
On the Content Opportunities page, clicking Send to Workflow when no workflow (webhook) is connected shows a long, generic error toast instead of a short, meaningful message:
An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this Error instance which may provide additional details about the nature of the error. …
The toast should be short and human-readable, e.g. "No workflow connected".
Steps to reproduce
- Sign in and open Content (
/dashboard/content) for a brand that has no active webhook/workflow configured. - On any opportunity, click Send to Workflow (or open an opportunity detail page and click Send).
- Observe the error toast.
Note: this only reproduces on a production build (
yarn build && yarn start), because Next.js redacts thrown Server Action errors in production. Inyarn devthe real message shows.
Expected behavior
A short toast with the real, user-facing reason, e.g. "No workflow connected".
Actual behavior
A long generic toast: "An error occurred in the Server Components render. The specific message is omitted in production builds…".
Deployment mode
Cloud (ansvisor.com) — but the root cause (production build redaction) applies to self-hosted production builds too.
Root cause & suggested fix (for contributors)
web/src/lib/actions/content.ts starts with 'use server', so sendToWebhook is a Server Action. It currently throws on non-OK responses. In production, Next.js redacts thrown Server Action errors and replaces the message with the generic "An error occurred in the Server Components render…" text, so the real message (returned by the server as { error: '...' }) never reaches the client toast.
Suggested approach: for expected/validation failures, return a result object instead of throwing, so the real message survives to the client.
- In
web/src/lib/actions/content.ts, changesendToWebhookto return a discriminated result, e.g.{ success: true; ... } | { success: false; error: string }, and return{ success: false, error }instead ofthrowing when!res.ok. - Update the two call sites to read the result and toast
result.erroron failure (keep thecatchfor truly unexpected errors with a short fallback like'Failed to send'):web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx→handleSendWebhookweb/src/app/[locale]/(dashboard)/dashboard/content/[id]/page.tsx→handleSend
- Optionally shorten the server-side message in
server/src/routes/content.js(the two/send-webhookhandlers) from "No active webhook configured for this brand. Set up a webhook first." to something concise like "No workflow connected".
How to verify: run a production build (yarn build && yarn start in web/) and confirm the short toast appears when sending with no workflow connected.
Please follow CONTRIBUTING.md for branch naming and Conventional Commits.
Activity
Sam-syntax35 commentedon Jul 10, 2026
Hi @gkhngyk, could you please assign these issues to me? I've already started working on them, and assigning them will help avoid duplicate PRs. Thanks!
gkhngyk commentedon Jul 12, 2026
Done via #400 (merged) — verified on main:
sendToWebhookandbulkSendToWebhookboth return structured results and the server message is the short "No workflow connected". The PR lacked a closing keyword, closing manually.