Typescript and Shotguns

TLDR: FML

CaptainLazarus
2 min readFeb 8, 2022
Me thinking how happy I would be kissing a shotgun after debugging for two days.

3 days. I spent 3 days debugging a fucking typescript project I pulled from github. For some basic shit.

If you really depressed or something, call these folks. Life is worth living m8.

Day 1

  1. Pulled github repo. Installed npm modules on client and server. Client works. Great. Now to work on server.
  2. Server seems to compile fine locally. Put files on server.
  3. Run npm build on server. Nothing. Script doesn’t work.
  4. Can’t access node. Lovely. npm runs from a local env, but node is installed in the root folder, and I can’t access it. wtf is this?
  5. How do I get the build folder in the terminal? Also, how do I install packages?
  6. Got it. I need to put the package.json file in the root folder. Initially, the scripts file wasn’t running because I couldn’t cd into the src file to run the server.js file. Fixed that.
  7. Server seems to be up and running. Some basic database error of not connecting to the database. Alright. Will take care of it tomorrow.

Day 2

  1. That database error isn’t solving itself. Create tables. Not working.
  2. Change credentials and database name and permissions. Not working.
  3. Checking error. Database isn’t running on local, but error is same. Error probably because of path stuff then.
  4. Don’t know how to check if online database is running.
  5. Keep changing different parameters and create multiple starter projects to understand what parameters will work for a basic typescript app.
  6. Nothing works. wtf.
  7. Do some magic, get a different error. Wait what?
  8. Google error. Apparently, it’s a versioning error.
  9. Screw around with different versions. Keep trying different combinations of tsconfig.json and package.json. Nothing works.
  10. Possibly some basic thing. Will check tomorrow. Read a bit about typescript and check the codebase.

Day 3

  1. Finally get local db up and running. Connect it to backend. Realise that it isn’t a db error that’s been screwing me.
  2. Almost become inspired by Kurt Cobain.
  3. Eyes slowly dying. Ask server person for help. Server person on gmeet. Suddenly, import error. Never seen before.
  4. wtf. Sit there for 30 minutes trying to fix. Apologise to server person for wasting his time. He tells good stories.
  5. Become inspired. Decide to keep solving problem.
  6. Have 30+ tabs open at one point. Laptop on the verge of filing a police complaint.
  7. Have a breakthrough. Discard all changes, go back to initial file.
  8. Change a few paths.
  9. Works.
  10. Look up. See Typescript creator laughing at me. Shotgun next to me. Thinking about firing.
  11. Remember Buddha. For a moment, have achieved Moksha. Scream into pillow “I DID IT”.
  12. Collapse from exhaustion. Happy, but exhausted.
  13. Life is good.

Sidenote: Haven’t written for some time. Lifestyle changes and mental health. Back now. Again.

Listen to USSR anthem and be happy.

https://www.youtube.com/watch?v=U06jlgpMtQs

--

--

CaptainLazarus
CaptainLazarus

Written by CaptainLazarus

I do stuff. Like stuff about code. And book stuff. And gaming stuff. And stuff about life. And stuff about stuff.