Help Needed: Issues Building Next.js Application in Production Mode
Unanswered
Reddish carpenter ant posted this in #help-forum
Reddish carpenter antOP
Hello,
I'm currently experiencing some challenges with building my Next.js application in production mode and I'm hoping to get some insights or suggestions from this community. Below, I've outlined the main issue, what I've tried so far, and some relevant details about my environment.
Issue Description:
When attempting to build my Next.js application in production mode, I'm encountering a prerender error. This issue only occurs when I try to build for production, as everything works as expected in the development mode.
Steps to Reproduce:
1. I start my docker container that is running a postgresql database using 'docker-compose up -d'
2. I attempt to build with this command 'npm run build'
Error Messages and Logs:
I've attached a screenshot of the output that I get from running the above command.
Environment Details:
Next.js version: 13.5.6
Node.js version: v18.18.2
OS: Fedora release 38 (Thirty Eight) x86_64
Browser (if relevant): Brave Version 1.60.110 Chromium: 119.0.6045.105 (Official Build) (64-bit)
What I've Tried So Far:
1. I've taken a look at every component that I have where my content is dynamically rendered. (My suspicion is that the error is being caused by my components that are rendering my tables. The problem is that I am relatively new to react and am unfamiliar with the way memory is managed.)
2. I've looked at the nextjs docs for steps to fix prerender errors and other relevant sources ie: reddit, stackoverflow, etc.
3. I've gone through and made sure to set each of my useState variables with default values.
4. I've tried changing my node version with 'nvm' to node 14, 16, and 20 to see if that had any effect.
I would really appreciate it if someone could point me in the right direction or suggest any potential fixes to try out. Any help or suggestions would be greatly appreciated! I have my source code uploaded on github here: https://github.com/PR1ZR4K1/SerialScripter_v2-next
Thank you in advance for your time and assistance!
I'm currently experiencing some challenges with building my Next.js application in production mode and I'm hoping to get some insights or suggestions from this community. Below, I've outlined the main issue, what I've tried so far, and some relevant details about my environment.
Issue Description:
When attempting to build my Next.js application in production mode, I'm encountering a prerender error. This issue only occurs when I try to build for production, as everything works as expected in the development mode.
Steps to Reproduce:
1. I start my docker container that is running a postgresql database using 'docker-compose up -d'
2. I attempt to build with this command 'npm run build'
Error Messages and Logs:
I've attached a screenshot of the output that I get from running the above command.
Environment Details:
Next.js version: 13.5.6
Node.js version: v18.18.2
OS: Fedora release 38 (Thirty Eight) x86_64
Browser (if relevant): Brave Version 1.60.110 Chromium: 119.0.6045.105 (Official Build) (64-bit)
What I've Tried So Far:
1. I've taken a look at every component that I have where my content is dynamically rendered. (My suspicion is that the error is being caused by my components that are rendering my tables. The problem is that I am relatively new to react and am unfamiliar with the way memory is managed.)
2. I've looked at the nextjs docs for steps to fix prerender errors and other relevant sources ie: reddit, stackoverflow, etc.
3. I've gone through and made sure to set each of my useState variables with default values.
4. I've tried changing my node version with 'nvm' to node 14, 16, and 20 to see if that had any effect.
I would really appreciate it if someone could point me in the right direction or suggest any potential fixes to try out. Any help or suggestions would be greatly appreciated! I have my source code uploaded on github here: https://github.com/PR1ZR4K1/SerialScripter_v2-next
Thank you in advance for your time and assistance!