DimitriGilbert / DimitriGilbert/Formedible

Wrong server interpretation

Open
#41 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
47
Forks
2
PR merge metrics
No merged PRs in 30d

Description

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;

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.