Skip to content

Error when generating app-shell #8825

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

Closed
tdesvenain opened this issue Dec 11, 2017 · 3 comments
Closed

Error when generating app-shell #8825

tdesvenain opened this issue Dec 11, 2017 · 3 comments

Comments

@tdesvenain
Copy link

tdesvenain commented Dec 11, 2017

Versions

Angular CLI: 1.6.0
Node: 6.11.5
OS: linux x64
Angular: 5.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.0
@angular-devkit/build-optimizer: 0.0.35
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.41
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0
@schematics/angular: 0.1.10
@schematics/schematics: 0.0.10
typescript: 2.4.2
webpack: 3.10.0

yarn 1.3.2 (same with npm 3.10.10)

Repro steps

  • ng new testshell
  • set angular 5.1.0 and add @angular/router
  • npm install
  • ng generate component home
  • add router-outlet
  • setup routes like that:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { RouterModule, Routes } from '@angular/router';

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

const appRoutes: Routes = [
  { path: '', component: HomeComponent },
]

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

Observed behavior

[~/projects/testshell]$ ng generate app-shell --route shell                                                                                       *[master] 
Cannot read property 'split' of undefined
TypeError: Cannot read property 'split' of undefined
    at Class.run (/home/tde/projects/testshell/node_modules/@angular/cli/commands/generate.js:110:63)
    at resolve (/home/tde/projects/testshell/node_modules/@angular/cli/ember-cli/lib/models/command.js:261:20)
    at Class.validateAndRun (/home/tde/projects/testshell/node_modules/@angular/cli/ember-cli/lib/models/command.js:240:12)
    at Promise.resolve.then.then (/home/tde/projects/testshell/node_modules/@angular/cli/ember-cli/lib/cli/cli.js:140:24)

@Shiroh1ge
Copy link

Shiroh1ge commented Dec 11, 2017

I was getting the same error, but I figured out I was entering the wrong command.
What you need to do is either:

ng generate app-shell <app-shell-component-name>  --universal-app=<universal-app-name> --route=<route>

or

ng generate app-shell [ --universal-app <universal-app-name>] [ --route <route>] // notice the brackets

Also duplicate of #8793

@Brocco
Copy link
Contributor

Brocco commented Dec 11, 2017

Closing...
Duplicate of #8793

@Brocco Brocco closed this as completed Dec 11, 2017
@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants