-
Notifications
You must be signed in to change notification settings - Fork 648
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
CLI Hooks ionic:serve:before is blocking ionic serve #2661
Comments
Looking a bit closer at the execution of the |
I'm guessing this has something to do with npm and the Ionic CLI handling the invocation of |
Agreed. The reason Using something like Being able to run parallel/concurrent scripts from lifecycle hooks/events might be too much of a stretch here, I guess... :) If no further insights pop to mind, this issue can be closed. |
@dnmd I know it's been a while, but I discovered why it hangs. We're waiting for the
For almost any use case, this works great. The one case it doesn't is if the child process spawns a process that uses the same stdio. Because I forgot why I used I'll give this some more thought. |
Description:
Defining an
ionic:watch:before
hook with a blocking script (e.g. an express server startup) will blockionic serve
. Since the close resemblance tonpm hook scripts
it is expected to execute in a similar way; whereprestart
is non blocking forstart
.Steps to Reproduce:
Clone repo: https://github.com/dnmd/cli-hooks
First
Non-blocking behaviour
This will executed both the
prestart
andstart
script.Blocking behaviour
This will only execute the
ionic:watch:before
script.Behaviour
When running
ionic serve
, theionic:watch:before
script is executed and opens a new terminal window, but doesn't continue the execution ofionic serve
. When runningnpm start
, theprestart
script is executed and opens a new terminal window and does continue the execution ofstart
.My
ionic info
:cli packages:
global packages:
local packages:
System:
The text was updated successfully, but these errors were encountered: