Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Don't allow builds when a package install is in progress #49

Closed
KyleAMathews opened this issue Jul 15, 2018 · 4 comments · Fixed by #253
Closed

Don't allow builds when a package install is in progress #49

KyleAMathews opened this issue Jul 15, 2018 · 4 comments · Fixed by #253
Labels
bug Something isn't working

Comments

@KyleAMathews
Copy link

Gorgeous app! Was really fun playing around with it a bit tonight.

I did manage to cause a build failure on accident. I added a new dependency (super nice) and while it was installing, somewhat absent-mindedly started a build which then failed of course because some of the dependencies had been deleted or moved around or whatever due to the ongoing install.

@KyleAMathews
Copy link
Author

Oh just noticed this also broke the develop server which was also running. Which is probably something we need to fix as we could probably detect this and die and restart (maybe?).

@joshwcomeau
Copy link
Owner

Hi Kyle! Thanks for checking Guppy out, glad you enjoyed it :D It's still super early days, but I'm excited to see where it goes from here.

There's some general weirdness with trying to do things while deps are installing (tracked in #33). My current not-very-great solution is to disable all dependency actions while one is in progress (since yeah trying to install a dependency while one is already installing will fail, as the package.json is currently write-locked). I could extend that solution to disable tasks while dependencies are installing.

It's very odd that it crashed the dev server! I don't remember running into that. I'll see if I can reproduce and follow-up if I can't for more info.

@joshwcomeau joshwcomeau added the bug Something isn't working label Jul 15, 2018
@joshwcomeau
Copy link
Owner

Alright, finally had some time to dig into this!

I wasn't able to reproduce this error. I tried the following:

  • Create a new Gatsby project
  • Start the development server
  • Start installing a new dependency (hello)
  • While it was installing, start a build

I repeated this a couple times with different dependencies (redux, lodash), as well as tried other things like formatting, and stopping/starting the dev server during installation.

@KyleAMathews if you can reproduce, can you share what the build failure + dev server crash were? For the dev server crash, I think we should be able to intercept that error and trigger a restart. For the build failure, we can just append additional error logs, something like "This may have failed because a dependency install was in progress. Please try again once the dependency installation has completed".

@joshwcomeau
Copy link
Owner

Ah, so I was actually able to replicate the build failure:

screen shot 2018-09-14 at 8 02 31 pm

It's disguised as a success, so I probably didn't notice it in my earlier testing.

It should be an easy fix; disable builds while there's an active dependency queue for the project. Will tackle shortly.

(have not been able to replicate the dev-server crash 🤔)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants