Skip to content

Commit 8fb33b0

Browse files
test(nextjs): Update type cast for integration test (#3930)
* test(nextjs): Update type cast to integration test Currently on master tests are failing with: ``` ./pages/users/[id].tsx:55:31 Type error: Object is of type 'unknown'. 53 | return { props: { item } }; 54 | } catch (err) { > 55 | return { props: { errors: err.message } }; | ^ 56 | } 57 | }; 58 | ``` To fix this, we cast err to `Error` type. Co-authored-by: Kamil Ogórek <[email protected]>
1 parent 314356e commit 8fb33b0

File tree

1 file changed

+1
-1
lines changed
  • packages/nextjs/test/integration/pages/users

1 file changed

+1
-1
lines changed

packages/nextjs/test/integration/pages/users/[id].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
5252
// will receive `item` as a prop at build time
5353
return { props: { item } };
5454
} catch (err) {
55-
return { props: { errors: err.message } };
55+
return { props: { errors: (err as Error).message } };
5656
}
5757
};

0 commit comments

Comments
 (0)