Quantcast
Channel: Recent Gists from badsyntax
Viewing all articles
Browse latest Browse all 31

nextjs-custom-server.md

$
0
0
nextjs-custom-server.md

Some pain points:

  • HMR is not always practical for server side development. For example HMR interferes with the initialisation of prom-client (and probably other libs), and there's no way to configure the HMR behaviour in Next.js (at time of writing).
    • "Interferes" meaning exceptions are thrown due to a "singleton" class being instantiated twice
  • If you're using TypeScript, you'll need a completely seperate build process for server code:
    • Generated server files are not part of the next build (ie don't exist within .next) - this is a pain when deploying or adding to a docker image
    • If you're consuming common code across the custom server and Next.js build, you're going to have 2 different compiled versions

Viewing all articles
Browse latest Browse all 31

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>