So I have a T3 stack app in which /src/server/api/routers/RouterX.ts
contains some info in an array that I have to maintain, but what happens is, every time there is a new page loaded, the server and client recompiles and I lose the data that was supposed to be maintained in the backend.
The following happens every time a new page is being loaded in the browser, for example I want to load /WaitingRoom
- wait compiling /WaitingRoom...
- event compiled client and server successfully in 231 ms (638 modules)
This compiled client and server successfully
refreshes the variables in RouterX.ts
. How would I fix this?
My package.json
has
"scripts": {
"build": "next build",
"dev": "next dev",
"postinstall": "npx prisma generate --schema=prisma/schema.prisma ",
"lint": "next lint",
"start": "next start"
}
and I'm using npm run dev
However, once I've loaded /WaitingRoom
and I want to load it back again, then the server doesn't get compiled again.
How do I make my data stay persistent/stop the server from recompiling like this?