How I analyzed and solved an error in my internship project
After getting approval for my engineering design document, I officially moved into the development phase of my project. I had spent time debugging the existing code, by adding breakpoints, to understand how parameters were passed to different functions for existing features related to my internship project. This debugging helped me get a better understanding of the code structure and the functions that might be relevant for different parts of my project, which has made the start of the development process a bit easier.
I
was adding a react-native component that will be the user interface for my
project this week. I edited different files that I knew would make the change,
but I got an error in the Android emulator when I tried seeing the
react-component I implemented. Although the error message in the emulator did
not have detailed information, I was able to see the file that specifically caused
the error. I attached breakpoints to some functions before and within the
erroring function. By stepping into these functions, I noticed that one of the
existing react-native components that I was importing into my react-native code
was returning an error and hence the entire function call returned an error. I
tried walking through a similar debugging process with existing react-native
components that use a similar import and I noticed that their imports were
recognized yet mine was not. To be sure it was not an error caused by caching,
I cleared my cache and restarted my build server. Instead of making the import
in other files that I used for my entry point, I tried making the import directly
in the code for my entry point and that resolved the import error I had.
Looking
back, I wish I spent less time stepping into some function calls that were
irrelevant to the error because that made me go down some rabbit holes that with
hard code to understand and that was diverting from solving the error. I also
wish I reached out to my mentor earlier because after telling her about my
error, she suggested different solutions I could have tried and maybe they
would have been a lot faster.
Comments
Post a Comment