Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appShell fails if the app already has a RouterModule #12138

Closed
alexeagle opened this issue Sep 4, 2018 · 8 comments
Closed

appShell fails if the app already has a RouterModule #12138

alexeagle opened this issue Sep 4, 2018 · 8 comments
Labels
area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@alexeagle
Copy link
Contributor

From @cexbrayat on November 24, 2017 23:18

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Area

- [ ] devkit
- [x] schematics

Versions

Repro steps

Generate a new app ng new hello.

Edit app.module.ts to add a RouterModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { AppComponent } from './app.component';

const routes: Routes = [];

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    RouterModule.forRoot(routes)
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Add router-outlet in index.html.
Run unviersal: ng g universal server-app
Run appShell: ng g app-shell shell --universal-app serverA-app

The log given by the failure

Error: Chunk cannot be found.
Chunk cannot be found.

Copied from original issue: angular/devkit#297

@alexeagle alexeagle added area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug labels Sep 4, 2018
@alexeagle
Copy link
Contributor Author

From @Brocco on December 5, 2017 18:10

PR #307 was merged to prevent this.

@alexeagle
Copy link
Contributor Author

From @cexbrayat on December 7, 2017 1:58

@Brocco maybe I'm missing something but I still reproduce with 1.6.0. It may be for another reason but the same steps lead to the same message.

@alexeagle
Copy link
Contributor Author

From @Brocco on December 14, 2017 15:2

I will investigate further, re-openeing

@alexeagle
Copy link
Contributor Author

From @EduardoIbarra on March 27, 2018 4:51

Is there a solution for this? I am facing the same problem

@alexeagle
Copy link
Contributor Author

From @PascalPrecht on April 4, 2018 12:50

I'm also running into this with CLI 1.7.3.

@ngbot ngbot bot modified the milestone: needsTriage Sep 4, 2018
@alexeagle
Copy link
Contributor Author

From @lawliet616 on April 11, 2018 9:21

For a workaround, I just simply remove the RouterModule and its import from the app.module.ts, run the ng generate app-shell command, then add the RouterModule back.

@alan-agius4
Copy link
Collaborator

Fixed by #11603

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

No branches or pull requests

3 participants