Bug description I am working with a library called react-carousel from brainhubeu in NextJS. Even when I am using dynamic import with ssr:false, The build UI looks strange but the dev UI is perfectly fine.
dev UI -

I have recreated it in Codesandbox too (this one is for dev environment is running npm run dev)-
https://codesandbox.io/embed/suspicious-volhard-460q8?fontsize=14&hidenavigation=1&theme=dark
However when I build it and then run the build by using npm run build && npm run start -

To recreate this in codesandbox -
- In bottom right click on + sign for a new terminal
- npm run build
- npm run start (I have already added "start": "next start -p 8080" in the package.json file so a new tab will be created for the sandbox and can be accessed as https://460q8-8080.sse.codesandbox.io/ where 8080 signifies the port number )
Expected behavior UI should be same as when seen with npm run dev.
Question
Why does my dev UI works fine but when I build and serve, the UI is strange. What exactly is the difference between npm run dev and npm run build && npm run start in context of NextJS?
Any solution to this problem?
My attempts
I have been trying to work on this problem and have asked this question on official Github discussions on NextJS. Couldnt find any answer.
I even created a Github Bug issue on react-carousel's Github, they couldn't help much.
Thanks for helping out.