Closed Yohanan-Negash closed 2 years ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
ngosi | ✅ Ready (Inspect) | Visit Preview | Jul 13, 2022 at 6:19PM (UTC) |
It looks like the Formik component is missing a prop. Try building locally on your machine to see the full error.
Here's the build output from Vercel.
[09:38:53.286] Cloning github.com/OneSignalDevelopers/ngosi (Branch: fixing-something, Commit: 5c776cf)
[09:38:54.358] Cloning completed: 1.072s
[09:38:54.655] Installing build runtime...
[09:38:56.786] Build runtime installed: 2.132s
[09:38:57.156] Looking up build cache...
[09:38:57.406] Build Cache not found
[09:38:57.667] Installing dependencies...
[09:38:57.988] yarn install v1.22.17
[09:38:58.073] [1/4] Resolving packages...
[09:38:58.326] [2/4] Fetching packages...
[09:39:22.140] [3/4] Linking dependencies...
[09:39:22.145] warning " > react-qr-code@2.0.2" has unmet peer dependency "react-native-svg@*".
[09:39:32.184] [4/4] Building fresh packages...
[09:39:32.737] Done in 34.76s.
[09:39:32.763] Detected Next.js version: 12.1.0
[09:39:32.766] Running "yarn run build"
[09:39:33.125] yarn run v1.22.17
[09:39:33.165] $ next build
[09:39:34.014] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[09:39:34.015] This information is used to shape Next.js' roadmap and prioritize features.
[09:39:34.015] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[09:39:34.016] https://nextjs.org/telemetry
[09:39:34.016]
[09:39:34.070] info - Checking validity of types...
[09:39:39.498] Failed to compile.
[09:39:39.498]
[09:39:39.498] ./components/Auth.tsx:31:6
[09:39:39.499] Type error: Property 'onSubmit' is missing in type '{ children: ({ errors, touched }: FormikProps<{ email: string; }>) => Element; initialValues: { email: string; }; validationSchema: ObjectSchema<Assign<ObjectShape, { email: RequiredStringSchema<string | undefined, AnyObject>; }>, AnyObject, TypeOfShape<...>, AssertsShape<...>>; }' but required in type 'FormikConfig<{ email: string; }>'.
[09:39:39.499]
[09:39:39.499] [0m [90m 29 | [39m[0m
[09:39:39.499] [0m [90m 30 | [39m [36mreturn[39m ([0m
[09:39:39.499] [0m[31m[1m>[22m[39m[90m 31 | [39m [33m<[39m[33mFormik[39m[0m
[09:39:39.500] [0m [90m | [39m [31m[1m^[22m[39m[0m
[09:39:39.500] [0m [90m 32 | [39m initialValues[33m=[39m{{[0m
[09:39:39.500] [0m [90m 33 | [39m email[33m:[39m [32m''[39m[0m
[09:39:39.500] [0m [90m 34 | [39m }}[0m
[09:39:39.525] error Command failed with exit code 1.
[09:39:39.525] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[09:39:39.538] Error: Command "yarn run build" exited with 1
@iAmWillShepherd PR is ready for review 👍
Fixes: #69
Solution
I used yup to handle email validation by creating a validation schema called
sendMagicLinkSchema
.I then added formik logic to validate email input and display an error if there is any. Since the yup validation schema validates for inputs not click events, I created a new state calledyupError
. This stores errors that come from our onlick event triggered when clicking on the 'Send magic link' button and the error message gets displayed if there is any. I also added additional styling to compensate for the addition of formik elements (<Formik>
,<Form>
&<Field>
).Testing
yarn dev
supabase start
/signin
pageResources