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 serve hangs on phase: emitting if no index.html file #19893

Closed
1 of 15 tasks
thekip opened this issue Jan 28, 2021 · 1 comment · Fixed by #19895
Closed
1 of 15 tasks

ng serve hangs on phase: emitting if no index.html file #19893

thekip opened this issue Jan 28, 2021 · 1 comment · Fixed by #19895
Assignees
Milestone

Comments

@thekip
Copy link

thekip commented Jan 28, 2021

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Description

ng serve command hangs for forever on:

⠏ Generating browser application bundles (phase: emitting)...

if no index.html file is present. This is a really confusing behaviour because it's hard to spot an issue.

Our build workflow is a bit more complicated than average. We have an additional step before ng serve which generates src/index.html (which will be consumed by Angular CLI later on).

The expected behaviour would be to show an error, the same way as in ng build command.

🔬 Minimal Reproduction

ng new test
rm ./test/src/index.html
ng serve

🌍 Your Environment


Angular CLI: 11.1.1
Node: 14.15.4
OS: darwin x64

Angular: 11.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1101.1
@angular-devkit/build-angular   0.1101.1
@angular-devkit/core            11.1.1
@angular-devkit/schematics      11.1.1
@schematics/angular             11.1.1
@schematics/update              0.1101.1
rxjs                            6.6.3
typescript                      4.1.3
@alan-agius4 alan-agius4 added area: devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken labels Jan 28, 2021
@ngbot ngbot bot added this to the needsTriage milestone Jan 28, 2021
@alan-agius4 alan-agius4 self-assigned this Jan 28, 2021
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Jan 28, 2021
alan-agius4 added a commit that referenced this issue Jan 28, 2021
…HtmlWebpackPlugin

Webpack doesn't handle promise rejections properly. With this change use use a try/catch block and add the error to the compilation.

Closes #19893
alan-agius4 added a commit that referenced this issue Jan 28, 2021
…HtmlWebpackPlugin

Webpack doesn't handle promise rejections properly. With this change use use a try/catch block and add the error to the compilation.

Closes #19893

(cherry picked from commit e02d737)
@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 Feb 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants