Unverified Commit ef7e70ee authored by Vicente Soriano's avatar Vicente Soriano Committed by GitHub

fix: typescript example supporting strict w/ version >= 4.4 (#33042)



## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

Closes: https://github.com/vercel/next.js/pull/32023
Fixes: https://github.com/vercel/next.js/issues/32015
parent 789a665a
...@@ -8,7 +8,7 @@ const handler = (_req: NextApiRequest, res: NextApiResponse) => { ...@@ -8,7 +8,7 @@ const handler = (_req: NextApiRequest, res: NextApiResponse) => {
} }
res.status(200).json(sampleUserData) res.status(200).json(sampleUserData)
} catch (err) { } catch (err: any) {
res.status(500).json({ statusCode: 500, message: err.message }) res.status(500).json({ statusCode: 500, message: err.message })
} }
} }
......
...@@ -55,7 +55,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => { ...@@ -55,7 +55,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
// By returning { props: item }, the StaticPropsDetail component // By returning { props: item }, the StaticPropsDetail component
// will receive `item` as a prop at build time // will receive `item` as a prop at build time
return { props: { item } } return { props: { item } }
} catch (err) { } catch (err: any) {
return { props: { errors: err.message } } return { props: { errors: err.message } }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment