-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[fsevents bug] Stuck at "source and transform nodes" / "createPagesStatefully" on MacOS #17131
Comments
Updated - I tested commenting out the gatsby-node.js file and the build progressed on one occasion, but then I tried again and doing this and it got stuck in the same spot again. Is there any chance this is due to my ancient computer, 2010 Macbook Pro (upgraded to 8GB Ram and an SSD), hasn't stopped me yet but I know its days are limited. This is a hobby for me and I have young kids so the dollars haven't been there to spend on a new computer since this one has worked fine with the upgraded Ram and SSD. |
I have tried to revert back to gatsby 2.13.52 which was the last version I was stable on, I have also tried reverting to react 16.8.6. Interestingly I had it build successfully one time when I reverted react to 16.8.6 but after that first time it hung up at the same spot which is really odd behaviour to me. |
I can also, rarely, for no reason I can discern get it to build fine. There does not seem to be a rhyme or reason for when this happens. I spent a couple of hours looking for patterns or errors that might be causing this but didn't find anything. I reviewed #6654 and tried some of the items in there to no avail. |
This is got to me one of the most odd bugs I have ever encountered because the behaviour seems to change without there being discernible change in the code. In some cases the build hangs at source and transform nodes(60% of time), in some cases it hangs at Create Pages Statefully(20%), in some cases it builds successfully (20%). I have had it display all three of these behaviours without changing a line of code. I have replicated this behaviour in gatsby-starter-blog as well, which is really odd. Again it makes me think this is an issue on my end locally. Interestingly it only hangs at I am now starting to think that it has something to do with a library that got updated by homebrew automatically - which one I have no idea but it is the only thing I can think of which I have not tested. Here is a list of the things I have tried so far:
|
Hello, I can do little but confirm that I'm seeing this issue on a number of gatsby starters. And, as you point out, it sometimes just decides to build or to stop building, hanging at either "source and transform nodes" or createPagesStatefully. Quite frustrating and leading to trying the most outrageous attempts to fix it. |
I did not witness this problem but this sounds awkward and I would really like to know the reason for this behaviour on your side. Preparation
Debugging will of course work with any IDE just make sure you attach your debugger correctly. 1. Variant: Minimal Reproductiion That way you might find where it hangs. 2. Alternative: Inside your project/starter Good luck. |
So...I ran into some weird behaviour with the lock files. Maybe someone who knows more could point me in the right direction. In the process of trying to get to a minimal working build I basically stripped down to a "hello world" Gatsby install and it still wasn't working which was really odd. Where it got even more strange was that the actual gatsby-starter-hello-world does work and build fine on my computer. BUT...if I delete the lock file and get yarn to rebuild a new lock file then the build starts failing, hanging at source and transform nodes. I could get my stripped down and minimal implementation to build if I copied the lock file from "hello-world" and used this. So my current theory is that there is some kind of version problem in my lock files that is causing this issue but I am stuck here. I also deleted all of my homebrew installs and reinstalled node, yarn, git, etc. Just to make sure it wasn't somekind of funny business there. |
Thanks @ehowey for raising this.... I thought it was just me because it is quite intermittent (but happens more than 50% of the time). Did the same as you to try and debug the situation. When I hang on If I find something I'll let you know. And I'll watch this thread too. |
@georgiee - thank you for the --inspect info. I'm going to see if I can get node debugging working with WebStorm. I also like your idea of a minimal reproduction. But that will take time while I understand Gatsby a little deeper. Currently it's hanging on "source and transform nodes". Rarely, it makes it to createPagesStatefully and hangs there. Otherwise it builds normally. |
I am currently facing the same problem after doing "yarn upgrade" to fix a vulnerable dependency. Here's my set up: System: |
Update: I manage to fix things by restoring my old "yarn.lock" file. |
My experience is that the problem can go away for no clear reason only to return later. You may find the problem returning despite restoring yarn.lock. Keep us posted. |
Here is a minimal reproduction using gatsby-starter-hello-world: https://github.com/ehowey/gatsby-test-lockfiles The current lock file included in the repo is the one failing for me. I have also included copies in the repo of My current environment: System: |
I am experiencing the same issue. Some direction I have found:
|
@sharvit I can report that this did not work in my case. Glad it fixed it for you, I do think it has something ultimately to do with the lock files and some weird version issue deep in the bowels of the lock file. I have managed to get back to a working build, most of the time, maybe 8/10 times by reverting to an old lock file and doing some copy and paste. I can now also CTRL+C to force quit the build if it is hanging which I couldn't do at one point in this process. I don't know what fixes it in the lock file but I think the clues are in the repository I posted above with two copies of a lock file, one that works and one that doesn't. This is an odd beast of a bug. Usually in computer land things reassuringly work or don't work. |
@steinitz Any luck on your end? I had what you mention happen. It seemed to get better, pretty good but not perfect and now is failing almost every time again. Pretty frustrating. |
As you might imagine, due to the on-again off-again nature of this problem, I'm hesitant to report. Here's a case in point: After deleting the node_modules directory, deleting yarn.lock then running Then, just now, in response to your message, I tried I suppose there are two sensible things to do:
|
Update: ctl-C'd the above stuck process (that didn't used to stop the stuck process which was doubly annoying). Don't know what to make of that, but there it is. |
This is similar to what I am seeing, tonight it seems worse maybe building successfully 1/10 times or less. From a programming/coding perspective this is super odd behaviour. Anecdotally it seemed to be working better a few days ago at 2.15.1 then today at 2.15.6. I also wonder what commonalities we all share that is causing this bug to happen. Can you run the It obviously isn't super widespread otherwise there would be a flood of reports but it also isn't just me like I originally thought. We all seem to be using yarn as well, which is a requirement for me as I am working on themes in a yarn workspace. I am still able to reproduce this on the gatsby-starter-hello-world so I believe it is some dependency issue or conflict in the core gatsby files. |
@ehowey here's the System: |
I was having the same issue: site built flawlessly on Netlify, but hung on my development machine with both After playing around with package versions, I noticed that reverting Edit: Spoke too soon, Gatsby still hangs at the "source and transform nodes" and "createPagesStatefully" steps, though much less frequently. |
@goblindegook this seems a common pattern with this particular issue. Because the issue comes and goes, seemingly with the weather, the time of day, time since boot up... you can believe something you've done has fixed it - only to have it recur. |
Experiencing this issue too, downgraded |
FWIW, I'm also experiencing this but use neither My
|
For me, cleaning the cache with |
I am still doing some hunting, trying to figure this out. Still a problem for me. Does anyone know if this might relate to the switch from babel 7.0.0 -> 7.5.5. This switch happened around the time I started experiencing this bug and coincides with me beginning to see problems...I have been trying to get yarn resolutions to work in order to peg the babel versions at 7.0.0 but haven't had success with this yet. |
I'm seeing this too with 2.15.28 when I do gatsby build. Do i need to stop the gatsby develop in the other terminal? It's intermittently happening |
Happened again without the dev server running. I've got a simple blog from following the blog tutorial though. |
It seems to be almost every other run. I'm on a Mac btw |
@canvaspixels does resizing the terminal window unstuck your build? If so, please try this and let us know if that helped #17938 (comment) |
@RomanHotsiy that indeed sorts it! Thanks! |
Hey everybody, the patched version of |
Be careful - deleting your whole Another, more precise option if you're using -
- fsevents@^2.0.6:
- version "2.0.7"
- resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.0.7.tgz#382c9b443c6cbac4c57187cdda23aa3bf1ccfc2a"
- integrity sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ== Another way of doing this is to use the
After you have done this and your lockfile is updated, you can remove the Edit: removed previous, incorrect version of instructions. |
You can also run |
Oh, wait. That's only if you have chokidar as a direct dependency 🙄 . Forgot. @karlhorky is right |
I'm using -- Edit: I actually finished what I was working on, pushed to Netlify and it was completely unable to build because of I switched to |
Got the same issue and could not track the reason. This happen to me both on mac and pc. Could try to relate this to internet speed, however this happened to me also when I was connected to high speed network. What seems to be working for me right now is to add this in my env
and running using |
In my case it seems to be my firewall prompt on osx. If I'm fast enough to allow or deny connections coming from outside, it'll succeed flawlessly. Problem is, the prompt dialog pops up for a split second and disapears as Gatsby continues and then fails hanging on one of the many steps mentioned above.
|
@thomasthep The default bind address for the dev server is localhost already. It doesn't even listen for external connections unless you tell it to use your out-facing IP address (or 0.0.0.0). And even then, it doesn't start the dev server until after the bootstrap / build are done. If it's the bootstrap that is causing the firewall prompt, then it would have more to do with what plugins you are using, because Gatsby does not reach out to the internet in its default state. There shouldn't even be any connections "coming from outside", generally speaking; even when a plugin is collecting information from an external source, the connection originates from your local host, not from the external source, and that is usually accepted as an "established connection" by most firewalls, in my experience, since most firewalls are configured to accept any outgoing connections. I could see this happening if your firewall is configured to block processes, rather than just connections. In that case, it would be Node that would need to be whitelisted. Would need more information to really understand why that's happening to you. It would probably be more effective to open a new ticket, though. This one had to do with |
For the record this also can happen if you have your GraphQL server running in debug mode and it's stopped at a breakpoint. |
For the record: This started happening to me when I added |
Weirdly resizing the terminal window worked for me |
For me, limiting concurrent downloads as described here seems to help. I added the following line to my .env file. The default is 200. Not sure if it solves your problem but maybe it helps someone :) |
Thank you, this fixed it for me. Since I was pulling a ton of content from a third party website it kept hanging on downloading the content. (97% - so close yet so far) |
I am having the same issue, it's building on fine on my mac and also on github runner which is a container running ubuntu-latest. but when i am trying to deploy it on prod which is ubuntu 16.x LTS it stucks at this line -
how can we remove the fsevents dependency completely ? |
In my case I had been working with a custom graphql server which seemed to get "socket hang up" error, I discovered this when I was using Restarting the custom server seemed to help. |
Description
I am working on a theme, local build was working fine with no problems, and recently upgraded all the dependencies to Gatsby 2.14.0 and both
gatsby develop
andgatsby build
hang atsource and transform nodes
in my local dev environment.Interestingly it works and builds on Netlify. This would point to it being something on my system. I have deleted the node modules folders in the workspaces and the root workspace folder and done a fresh yarn command. I also deleted the yarn.lock and package.lock files...not sure if this would cause problems.
Steps to reproduce
Theme repo is here: Gatsby-Theme-Catalyst-Core
Starter repo is here: Gatsby-Starter-Catalyst-Core
I have this setup in a yarn workspace for development however the same issue occurs if you do a fresh install of the starter using
gatsby new my-catalyst-starter-core https://github.com/ehowey/gatsby-starter-catalyst-core
Expected result
Build successfully
Actual result
yarn workspace v1.17.3
yarn run v1.17.3
$ gatsby develop
success open and validate gatsby-configs - 0.122 s
success load plugins - 1.964 s
success onPreInit - 0.073 s
success initialize cache - 0.056 s
success copy gatsby files - 0.242 s
success onPreBootstrap - 0.087 s
⠙ source and transform nodes
Environment
System:
OS: macOS High Sierra 10.13.6
CPU: (2) x64 Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.9.1 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.11.2 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/local/bin/python
Browsers:
Chrome: 76.0.3809.100
Firefox: 67.0.2
Safari: 12.1.2
npmGlobalPackages:
gatsby-cli: 2.7.40
The text was updated successfully, but these errors were encountered: