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

ng build doesn't generate app shell #11478

Closed
LastDragon-ru opened this issue Jul 6, 2018 · 8 comments · Fixed by #12965
Closed

ng build doesn't generate app shell #11478

LastDragon-ru opened this issue Jul 6, 2018 · 8 comments · Fixed by #12965
Labels
area: devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity1: confusing type: bug/fix

Comments

@LastDragon-ru
Copy link

LastDragon-ru commented Jul 6, 2018

Bug Report or Feature Request (mark with an x)

- [x] bug report 
- [ ] feature request

Area

- [x] devkit
- [x] schematics

Versions

Angular CLI: 6.0.8
Node: 8.11.2
OS: win32 x64
Angular: 6.0.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.8
@angular-devkit/build-angular     0.6.8
@angular-devkit/build-optimizer   0.6.8
@angular-devkit/core              0.6.8
@angular-devkit/schematics        0.6.8
@angular/cli                      6.0.8
@ngtools/webpack                  6.0.8
@schematics/angular               0.6.8
@schematics/update                0.6.8
rxjs                              6.2.1
typescript                        2.7.2
webpack                           4.8.3

Repro steps

  1. Create a new project with routing ng new app-shell-test --routing
  2. Add app shell to project ng g app-shell --universal-project=app-shell-test --client-project=app-shell-test
  3. Build project with ng build or ng build --prod

Actual

The app shell is not generated.

Mention any other details that might be useful

I'm trying to add the app shell to my app, but ng build not want to generate it. The shell generates only after ng run app-shell-test:app-shell. Is this a valid behavior or a bug? (in the first case the --skip-app-shell is unused...)

@filipesilva
Copy link
Contributor

This is the intended behavior, yes. It is documented in https://github.com/angular/angular-cli/wiki/stories-app-shell.

@LastDragon-ru
Copy link
Author

LastDragon-ru commented Aug 10, 2018

@filipesilva,

  1. on linked page I don't see anything about ng build
  2. ng build have the --skip-app-shell and this option worked prior to 6.0, see https://github.com/angular/angular-cli/wiki/build BUT this option fully ignored now => shell will never be generated during ng build
  3. if this is "intended behavior" and app shell not generating during ng build
    • how can I use app with generated app shell in production? Build and shell will generate the different hashes, right? so the shell seems is unuseful...
    • why --skip-app-shell still here?

@filipesilva
Copy link
Contributor

There isn't anything there about ng build because the way you build the app shell is via ng run my-app:app-shell. You'll find your built project in the dist directory, with the app shell inside index.html.

--skip-app-shell shouldn't be there anymore though. That option should error out. I'll reopen so someone can remove that option from the allowed list.

@filipesilva filipesilva added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity1: confusing labels Aug 10, 2018
@filipesilva filipesilva reopened this Aug 10, 2018
@LastDragon-ru
Copy link
Author

--skip-app-shell shouldn't be there anymore though.

Ok, thank you :)

@myrddraall
Copy link

So i'm confused, ng build doesn't generate the app shell and ng run my-app:app-shell doesn't generate the service worker. How do you build a pwa with an app shell?

@geometricpanda
Copy link

Also running ng-run my-app:app-shell doesnt build optimised files. Basic vendorJS greater than 3mb.

@d2kx
Copy link

d2kx commented Sep 23, 2018

@JimDrury you can use ng-run my-app:app-shell -c production if you generated the app-shell with the CLI to have a production build with app-shell enabled. This also works together with Angular Universal+Angular Service Worker, something I also initially struggled with.

@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: devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity1: confusing type: bug/fix
Projects
None yet
6 participants