when i am running prod build locally everything works fine. But when code is build in jenkins and deployed in QA environment i am getting cyclic dependency error.

I tried prod build and from dist folder tried to run the application using lite-server npm plugin everything works fine, without any error or warning.

I understand the issue after going through already raised issues, but i don't understand why it's working locally but not when done by build server in Jenkins.

does angular builds application differently in jenkin (unix based) compared to local system (windows) ??

Edit am using default angular.json/package.json generated after doing ng new.

the only thing there is APP_INITIALIZER, which gets the system level configuration before bootstrapping angular app and flow is something like:

AppInitializer --> restConnector(service for making BE calls) --> httpClient and once output is returned in the success block of http Call, am saving this information in another service like below:

appInitializer --> store value in service and then redirect using angualar Router Service.

As this is only throwing error in jenkins build, i couldn't even share repro.

1

There are 1 best solutions below

1
On

Making a prediction here is hard as we do not have enough information of what's going on from my point of view.

Can you provide us the exact build commands you are running? And also your Angular version? There might be small but important differences.

I could imagine that the Jenkins is running the linter, which your local build does not. This could be a difference of

ng build

to

ng build --prod

as far as I can tell. But this also depends on your "script bindings". For this, you could also attach your package.json scripts part (at the very top) just to check if any scripts have different bindings than the default one.