blitz-js / babel-plugin-superjson-next

Automatically transform your Next.js Pages to use SuperJSON
MIT License
125 stars 15 forks source link

Does not work with decorated getServerSideProps #96

Closed vincaslt closed 2 years ago

vincaslt commented 2 years ago

I'm implementing auth with https://github.com/gladly-team/next-firebase-auth and it requires to decorate both getServerSideProps and the component with their HOFs.


export const getServerSideProps = withAuthUserTokenSSR({
  whenUnauthed: AuthAction.REDIRECT_TO_LOGIN,
})(async ({ AuthUser }) => {
  ...
  return {
    props,
  };
});

export default withAuthUser<ServerSideProps>()(Component);

My payload includes Date and I logged it in the component - it's string.

Skn0tt commented 2 years ago

Hi @vincaslt! Thank you for opening this issue. I published a fix in v0.4.1, let me know if that didn't work.