angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

"ng build -prod" results in unexpected behaviour of the application

Open slade-2k opened this issue 10 years ago • 3 comments

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Windows 7, 10 and Debian

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.21 node: 6.9.1 os: win32 x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

The log given by the failure.

Normally this include a stack trace and some more information.

No Error in the logs or the console

Mention any other details that might be useful.

When I build my Angular Frontend with "ng build --base-href "and deploy it to tomcat 7 (tested on debian, windows 7 and windows 10) everything works fine. But when I try to build with the "-prod" flag the Application goes crazy. Lists are beeing reversed on every click, menus are not opening and so on. The web console is empty there are no errors or anything but the Application acts like the prod build messed it up really bad.

So "ng build" and even "npm start" (I know its a different server in this case) works totally fine, but as soon as the -prod flag is used, the app behaves really strange and I can not see why.

The console output and logs seem to be fine, there is one warning at the start of the build process saying:

"WARNING in main.42171ac1a8f439b4975c.bundle.js from UglifyJs" The other entries are just unused functions and side effects of unused variables.

let me know if you have any suggestions, really appreciate your help :)


Thanks! We'll be in touch soon.

slade-2k avatar Nov 24 '16 13:11 slade-2k

Does ng serve --prod also exhibit this behaviour?

filipesilva avatar Dec 29 '16 17:12 filipesilva

Closing as inactive.

filipesilva avatar Jan 24 '17 18:01 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.