Errors after build
Unanswered
Japanese common catfish posted this in #help-forum
Japanese common catfishOP
Hi,
I have a quite annoying issue. Running NextJS-app on Ubuntu, reverse proxy behind Apache. PM2 to handle the node process itself.
Problem:
I push updates quite often, and have quite a bit of users. After a push to the remote git repo, I run these commands:
npm run build (Building new release)
pm2 restart [process number]
That works fine by itself, but whenever users with an active session navigate to any page on my app, they get an exception. Typically that various objects returned from getServerSideProps are undefined. Reloading the page resolves the issue, and the user can continue as usual. This is especially annoying for users who's had the window open for ~24 hours, trying to access the payment page - and boom, exception.
What am I doing wrong? What configuration am I missing? I do understand that running a new build will generate new files in .next, and that's probably the issue. But how do I avoid this? Obviously I want my users to continue using the app even tho I run a new build, without them even knowing.
FYI: Tried Googling, but didn't find any solution.
I have a quite annoying issue. Running NextJS-app on Ubuntu, reverse proxy behind Apache. PM2 to handle the node process itself.
Problem:
I push updates quite often, and have quite a bit of users. After a push to the remote git repo, I run these commands:
npm run build (Building new release)
pm2 restart [process number]
That works fine by itself, but whenever users with an active session navigate to any page on my app, they get an exception. Typically that various objects returned from getServerSideProps are undefined. Reloading the page resolves the issue, and the user can continue as usual. This is especially annoying for users who's had the window open for ~24 hours, trying to access the payment page - and boom, exception.
What am I doing wrong? What configuration am I missing? I do understand that running a new build will generate new files in .next, and that's probably the issue. But how do I avoid this? Obviously I want my users to continue using the app even tho I run a new build, without them even knowing.
FYI: Tried Googling, but didn't find any solution.