#Next.js not using latest server code during dev

3 messages · Page 1 of 1 (latest)

pearl apex
#

Next.js not using latest server code during dev

#

I have no idea why, but code that only runs on the server isn't recompiled (or at least isn't executed).

├── src
│   ├── models
│   │   ├── install
│   │   │   └──  install.ts
│   ├── pages
│   │   ├── _app.tsx
│   │   ├── _document.tsx
│   │   └── index.tsx
// index.tsx
import { getInstall } from '../models/install/install';

export const getServerSideProps: GetServerSideProps<Props> = (ctx) => {
   return {
       props: {
          install: await getInstall(ctx.req)
       }
   };
}
#

Ok, so it turns out the issue was because getInstall reads from ctx.req.installwhich is created in my custom server, which naturally, isn't hot loaded