Skip to content

Wrong server interpretation #41

@AgneauAntoine

Description

@AgneauAntoine

Error on server log :
Error: Failed to find Server Action "x". This request might be from an older or newer deployment. Read more: https://nextjs.org/docs/messages/failed-to-find-server-action at async m (.next/server/app/page.js:1:19312) at async p (.next/server/app/page.js:2:1860) at async L (.next/server/app/page.js:2:6944)

Diagnostic :
Le problème venait du fait que Next.js 13+ interprète toute prop action sur un élément

comme une référence à un Server Action. En renommant cette prop en formAction, nous évitons cette confusion tout en conservant la fonctionnalité.

Solution :
fix: resolve Server Action error by renaming action prop to formAction

  • Renamed 'action' prop to 'formAction' in FormProps interface
  • Updated useFormedible hook to use 'formAction' instead of 'action'
  • Prevents Next.js from interpreting the prop as a Server Action
  • Fixes 'Failed to find Server Action' error in production

This change resolves the deployment error where Next.js expected a Server
Action but found an API route-based form submission pattern.

To do (replace) :

apps/web/src/hooks/use-formedible.tsx :

  • L1433 : action, => formAction,
  • L2234 : action={action} => action={formAction}

apps/web/src/lib/formedible/types.ts :

  • L1094 : action?: string; => formAction?: string;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions