Skip to content

Commit 90cd4e0

Browse files
authored
examples(with-supabase): fix action type error (#72783)
## Why? There is a type issue with one of the form actions. ``` app/(auth-pages)/sign-up/page.tsx:42:25 - error TS2322: Type '(formData: FormData) => Promise<{ error: string; }>' is not assignable to type 'string | ((formData: FormData) => void | Promise<void>) | undefined'. Type '(formData: FormData) => Promise<{ error: string; }>' is not assignable to type '(formData: FormData) => void | Promise<void>'. Type 'Promise<{ error: string; }>' is not assignable to type 'void | Promise<void>'. Type 'Promise<{ error: string; }>' is not assignable to type 'Promise<void>'. Type '{ error: string; }' is not assignable to type 'void'. 42 <SubmitButton formAction={signUpAction} pendingText="Signing up..."> ``` - x-ref: #72778
1 parent 2cd75cc commit 90cd4e0

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

examples/with-supabase/app/actions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ export const signUpAction = async (formData: FormData) => {
1212
const origin = (await headers()).get("origin");
1313

1414
if (!email || !password) {
15-
return { error: "Email and password are required" };
15+
return encodedRedirect(
16+
"error",
17+
"/sign-up",
18+
"Email and password are required",
19+
);
1620
}
1721

1822
const { error } = await supabase.auth.signUp({

examples/with-supabase/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@
1212
"@radix-ui/react-slot": "^1.1.0",
1313
"@supabase/ssr": "latest",
1414
"@supabase/supabase-js": "latest",
15-
"autoprefixer": "10.4.17",
15+
"autoprefixer": "10.4.20",
1616
"class-variance-authority": "^0.7.0",
1717
"clsx": "^2.1.1",
1818
"geist": "^1.2.1",
19-
"lucide-react": "^0.436.0",
19+
"lucide-react": "^0.456.0",
2020
"next": "latest",
21-
"next-themes": "^0.3.0",
21+
"next-themes": "^0.4.3",
2222
"prettier": "^3.3.3",
23-
"react": "18.2.0",
24-
"react-dom": "18.2.0"
23+
"react": "18.3.1",
24+
"react-dom": "18.3.1"
2525
},
2626
"devDependencies": {
27-
"@types/node": "20.10.6",
28-
"@types/react": "18.2.46",
29-
"@types/react-dom": "18.2.18",
30-
"postcss": "8.4.33",
27+
"@types/node": "22.9.0",
28+
"@types/react": "^18.3.12",
29+
"@types/react-dom": "18.3.1",
30+
"postcss": "8.4.49",
3131
"tailwind-merge": "^2.5.2",
32-
"tailwindcss": "3.4.1",
32+
"tailwindcss": "3.4.14",
3333
"tailwindcss-animate": "^1.0.7",
34-
"typescript": "5.3.3"
34+
"typescript": "5.6.3"
3535
}
3636
}

0 commit comments

Comments
 (0)