Skip to content

Commit ef7e70e

Browse files
authored
fix: typescript example supporting strict w/ version >= 4.4 (vercel#33042)
## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint` Closes: vercel#32023 Fixes: vercel#32015
1 parent 789a665 commit ef7e70e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/with-typescript/pages/api/users/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const handler = (_req: NextApiRequest, res: NextApiResponse) => {
88
}
99

1010
res.status(200).json(sampleUserData)
11-
} catch (err) {
11+
} catch (err: any) {
1212
res.status(500).json({ statusCode: 500, message: err.message })
1313
}
1414
}

examples/with-typescript/pages/users/[id].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
5555
// By returning { props: item }, the StaticPropsDetail component
5656
// will receive `item` as a prop at build time
5757
return { props: { item } }
58-
} catch (err) {
58+
} catch (err: any) {
5959
return { props: { errors: err.message } }
6060
}
6161
}

0 commit comments

Comments
 (0)