In all seriousness, if you are here to solve your problem then you might be better going to Stackoverflow and trying what is described there.
If you tried that but with no luck… continue reading…
When we want someone to help us fix a problem we have never seen before it’s good practice to explain what led to the problem in the first place.
This is one of the reasons Stackoverflow and other Issue tracking systems such as Jira exist, and you can learn more about how to ask questions here. Simply put, the context of the problem is important!
- I cloned this lovely Gatsby Blog Starter Template to mess around and see if it met my needs.
After adding a few changes I decided to replace the existing landing page I had hosted with Github pages with this template, there are a few different ways I could have done this but I chose to recursively copy my changes into the other directory where the landing page was.
rm -rf ./github/blog/* cp -R ./github/gatsby-starter-lumen/ ./github/blog cd ./github/blog npm install
- This didn’t work out, we don’t want to copy of the
.gitfiles from one repository to the other as that would stop our local from working with the remote. Upon running the development server using
gatsby develop, halfway through I encountered the following error:
I had seen this error once before when writing an inefficient looping algorithm . It seems that the v8 engine has a memory limit in place by default, and a quick search confirms this is a well documented issue. So I tried what was recommended…
NODE_OPTIONS="--max-old-space-size=4096" gatsby develop. The results were the same, the heap ran out of memory.
- Googling further into this problem, I checked for if others had issues with
mark-compacts. Hurray that turned up answers as well, and even an in depth guide on debugging memory leaks… Essentially the article explains how to find objects in your application run time that are not being correctly cleaned up, and at this stage I begin to ask myself if this is a rabbit hole I want to continue with…
When in doubt, it is often cost-effective to start again. Since I knew I wanted to use this blog template I forked the original (thanks @alxshelepenok) and quickly made all the changes I had made before.
The original goal I set out to achieve was to get a blog ready to start sharing some knowledge around topics I have been working on. It’s always important to keep in mind the underlying motivations behind doing something, and to check in with yourself to see if the problem you are solving will help you reach your objective.
So don’t forget you can always go back to the beginning!