title: Error: Invalid configuration of route ''. One of the following must be provided: component, redirectTo, children or loadChildren
body: <p>I'm setting up ' ' path based on a condition which is working fine and setting up the route to ' ' path. I works fine on my development server. But when i build the project and run it on production server it gives me this error.</p>
  
  <p>Uncaught Error: Invalid configuration of route ' '. One of the following must be provided: component, redirectTo, children or loadChildren</p>
  
  <p>This is my app-routing.module.ts</p>
  
  <pre><code>const fallback: Route = {
    path: '**',
    component: NotFoundComponent
  }
  
  var   home: Route = {};
  
  const hostName = window.location.host;
  console.log('hostName: ', hostName);
  var workspaceName = hostName.split('.')[0];
  console.log('workspaceName: ', workspaceName);
  
  if (workspaceName === 'peprix' || workspaceName === 'www') {
    console.log("if");
    let homeRoute: Route = {
      path: '', component: MainComponent
    }
    home = homeRoute;
  } else {
    console.log("else");
    let homeRoute: Route = {
      path: '', canActivate: [SessionGuard], data: { workspaceName: workspaceName }, resolve: { workspaceId: SigninService }, component: SigninNextComponent
    }
    home = homeRoute;
  }
  
  const routes: Routes = [
    home,
    { path: 'signin', canActivate: [SessionGuard], component: SigninComponent, data: { workspaceName: workspaceName } },
    { path: 'create-workspace', canActivate: [SessionGuard], component: CreateWorkspaceComponent },
    { path: 'projects', canActivate: [ProjectGuard], component: ProjectComponent },
    { path: 'password-reset', component: PasswordResetComponent },
    { path: 'new-password', component: NewPasswordComponent },
    fallback
  ];
  
  @NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule],
    providers: [
      ProjectDetailsService,
      SigninService
    ]
  })
  export class AppRoutingModule { }
  </code></pre>
  
  <p>P.S: I've imported all the components and dependencies so it ain't a problem here.</p>