From 381cbe35e907758ba3bfea824b2ee08dee0eac39 Mon Sep 17 00:00:00 2001 From: vicente-s Date: Wed, 5 Jan 2022 12:36:48 -0500 Subject: [PATCH] fix for issue #32015, closes #32023 --- examples/with-typescript/pages/api/users/index.ts | 2 +- examples/with-typescript/pages/users/[id].tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/with-typescript/pages/api/users/index.ts b/examples/with-typescript/pages/api/users/index.ts index 4efdba6f1a4e7..67a645ea39199 100644 --- a/examples/with-typescript/pages/api/users/index.ts +++ b/examples/with-typescript/pages/api/users/index.ts @@ -8,7 +8,7 @@ const handler = (_req: NextApiRequest, res: NextApiResponse) => { } res.status(200).json(sampleUserData) - } catch (err) { + } catch (err: any) { res.status(500).json({ statusCode: 500, message: err.message }) } } diff --git a/examples/with-typescript/pages/users/[id].tsx b/examples/with-typescript/pages/users/[id].tsx index 61720da5a7a5d..ca442c0c16a4b 100644 --- a/examples/with-typescript/pages/users/[id].tsx +++ b/examples/with-typescript/pages/users/[id].tsx @@ -55,7 +55,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => { // By returning { props: item }, the StaticPropsDetail component // will receive `item` as a prop at build time return { props: { item } } - } catch (err) { + } catch (err: any) { return { props: { errors: err.message } } } }