In this blog post, I am going to talk about my first attempt to actually contributing to an open source project. This wasn’t the first time I have contributed to an open source project, the first time was when I added some keywords to a nodejs project that I have documented here and have landed. However, it was for me to practice on how to do a merge request. This time I am actually fixing a bug in a project and this time is Thimble. I looked at the list of “good first bug” issues and pick this issue I have also explained why I picked this one.
This issue seemed easy at first but then I started to over-complicated the issue. I noticed an exception on the console when I tried to reproduce the bug:
Uncaught TypeError: Cannot read property 'fullPath' of null at Object.loaded (RemoteEvents.js:135) at finishStartup (main.js:124) at UI.js:60 at Directory.getContents (Directory.js:152) at UI.js:39 at UI.js:320 at HTMLIFrameElement.onload (compatibility.js:50)
The first thing I decided to do was to look for the code that was called before the loaded() function was called so that it won’t produce this error and I also looked at where Thimble told Brimble to which root directory to mount and where Brimble check if the given path exists. They didn’t lead to any result for me as they all work as they should.
Then I decided to try to reproduce this bug with Brimble without Thimble and it shows this error message:
Finally, I came back to where I started with the loaded() function. I am pretty sure this is where I need to fix the issue but not sure how I would fix. I contacted my professor for advise, and he showed me how to fix issue. Although, as he said:
This isn’t a complete fix, because we probably need to inject a default
index.htmlfile in the filesystem if there isn’t one, and do it prior to this code being called. However, this will at least stop the crash, and let the initial loading complete.
For now, it fixed the issue but it’s not solving the issue of not having a default index.html file. In the future, I will probably continue on this if I can use this for the second release.
There was an interesting detail I spotted when I ran the
npm run build command, it required my code to have double indentation. I am not sure if it is a Nodejs requirements or it is an enforced rule for this specific project. Definitely I will ask the professor for clarification.
Overall, the process were challenging, especially navigating through the project to find what I need and also understanding what the code does, documentation/comments were very helpful in this case. In addition, I shouldn’t have over-complicated the problem as the problem was already in front of my face.