Followed the example from Actual Implementation and dynamic loading of okta config works till npm v 1.2.2. The functionality is broken in npm version 1.3.0.
In order to reproduce the issue, in the above stackblitz example, change npm version of okta angular to 1.3.0
The build works fine in dev mode, but when you run it in aot(npm run build --prod), the build errors out. Screenshot of error below