SOLUTION
I figured out a solution to my problem.
When I realized that the Subscriber (and the eventBusService etc) was never initialized let me into the thought process that my project did not handle my TS files correctly.
It turns out that my subscriber and service while written in TS was not transpiled/compiled as expected.
Then I looked into MedusaJS and TypeScript and found a PR that added support for typescript (medusajs/medusa-starter-default#9)
I then decided to read through the changes and add the ones relevant for my project (for now).
I updated my package.json file with a build script:
"scripts": {
"build": "tsc -p tsconfig.json",
"start": "npm run build && medusa develop"
},
I added the following to the my tsconfig.json
{
"compilerOptions": {
"experimentalDecorators": true,
},
"extends": "./tsconfig.base.json",
"include": ["src"],
"exclude": ["node_modules", "**/*.spec.ts"]
}
I added a tsconfig.base.json file
{
"compilerOptions": {
"lib": ["es5", "es6"],
"target": "esnext",
"allowJs": true,
"esModuleInterop": false,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"declaration": false,
"sourceMap": false,
"outDir": "./dist",
"rootDir": "src",
"baseUrl": "src"
},
"exclude": ["node_modules"]
}
I updated my develop.sh script to run the same commandos as the npm start script
medusa migrations run
npm run build
medusa develop
Then I ran my docker commands
docker-compose up --build -d
Boom. The Medusa_backend log showcased that the Subscriber was initialized and the subscriber worked as intended.