Difference `npm run dev` and `npm run build` with `npm start`
Unanswered
American posted this in #help-forum
AmericanOP
Hi folks, I'm new to React JS and Next JS.
When I run the project via npm run dev command everything looks fine. However when I run npm run build with npm start it has missing UI/actions/requests.
Question: What is the main difference between npm run dev and npm run build with npm start? I am trying to run a project in a docker container. Any suggestion?
When I run the project via npm run dev command everything looks fine. However when I run npm run build with npm start it has missing UI/actions/requests.
Question: What is the main difference between npm run dev and npm run build with npm start? I am trying to run a project in a docker container. Any suggestion?
27 Replies
@American  Hi folks, I'm new to React JS and Next JS.
When I run the project via npm run dev command everything looks fine. However when I run npm run build with npm start it has missing UI/actions/requests.
Question: What is the main difference between npm run dev and npm run build with npm start? I am trying to run a project in a docker container. Any suggestion? 
npm run dev will start the dev servernpm run build then npm start will create a  production build and start the server@American  Hi folks, I'm new to React JS and Next JS.
When I run the project via npm run dev command everything looks fine. However when I run npm run build with npm start it has missing UI/actions/requests.
Question: What is the main difference between npm run dev and npm run build with npm start? I am trying to run a project in a docker container. Any suggestion? 
it has missing UI/actions/requests.do you have
output: 'standalone' in next.config.js?AmericanOP
Hi, thanks for your reply. I confirm that there is no such 
output: 'standalone' in the next.config.js file. Should I add it to the next.config.js file?I added it but it didn't help.
@American  Hi, thanks for your reply. I confirm that there is no such `output: 'standalone'` in the `next.config.js` file. Should I add it to the `next.config.js` file? 
are you trying it with just 
npm run build and npm start or in docker?AmericanOP
Yes I've run 
npm run build with npm start. without in docker.how did you create the project? with create-next-app?
AmericanOP
Yes using it with tailwind.
@Ray  how did you create the project? with create-next-app? 
AmericanOP
I don't know exactly. I'll ask.
Project structure:
Project structure:
@American  I don't know exactly. I'll ask.
Project structure: 
have you imported the 
global.css in layout.tsx?AmericanOP
Yes
can you try deploy it on vercel and share the url to me?
AmericanOP
Sorry, I can't. what exactly are you trying to check? I will provide to you.
check the url for the css
AmericanOP
is that what you mean?
is it accessible?
AmericanOP
Yes
but no style applied on the html?
AmericanOP
they are used
ah what do you mean missing UI/actions/requests?
AmericanOP
Missing UI:
active chat panel missing
Missing requests:
first request missing in build version.
first request missing in build version.
is the page static generated? and doing client side fetching?
AmericanOP
It's dynamic  generated and doing it client side
AmericanOP
Thanks! I've fixed it. It turns out that the wrong logic was written in 
useEffect