cypress-io / cypress-mock-ssr

Node.js Mock SSR Middleware and Cypress Commands
MIT License
16 stars 5 forks source link

Do not advise to use a custom server in Next.js #4

Closed eric-burel closed 3 years ago

eric-burel commented 3 years ago

Second issue I notice about Next.js in the README: you advise users to create a custom server. The problem is that it's an anti-pattern that leaves you out of Next.js pit of success. I understand that it's tempting, the underlying issue is that Next currently expose no way to add a custom middleware to their internal server, which leads to all sort of limitations in Next.js app (eg people using getServerSideProps just to check auth, which lead to a suboptimal experience).

The readme requires, at least, a warning that a custom server is an advanced feature. Imo the right solution in the long run would be to run an additional proxy server in front of Next.js (but that's kinda beyond my current skillset :)).

kevinold commented 3 years ago

Add clarification for use with Next.js de67dfa