1

I am facing a really weird issue. I searched for it on SO and other websites but could not find any reference to this issue.

Basically, when I am serving the Angular Ngx-admin app using ng serve command, it becomes mobile responsive.

But as soon as I try to serve the ng build distribution files through a static server, the app loses the responsiveness.

I tried various ways like NodeJS http-server, simple NodeJS Express App, PM2 Serve (pm2 serve --spa) but everything is giving the same output.

I am not getting what is going wrong here.

Here's the screenshot of responsive app using ng serve

responsive app using ng serve


Here's the non-responsive app using static file serving

non-responsive app using static file server

planet_hunter
  • 3,866
  • 1
  • 26
  • 39
  • did you check angular.Json file ? is there any differences between build and serve? specialy in "styles" key – Ali Mirzaie Apr 24 '22 at 05:45
  • @AliMirzaie I compared the 2 and found no difference. I had modified the ngx-admin code base which had this issue. I created a new angular application from scratch and it seems to be working fine now. So I am not sure what was the exact cause. Thanks for the help! – planet_hunter Apr 25 '22 at 17:14
  • any luck on it? I am facing same issue.. – vishal-mote Feb 05 '23 at 05:27
  • just changed "optimization": true to "optimization": false in angular build and issue has been resolved. now question comes that whats wrong happening while optimizing our build? – vishal-mote Feb 05 '23 at 06:56

0 Answers0