The only solution i’ve found to this is to create a single-type entity, and add the service there. For some reason a content-types and/or controllers and/or routes folder is required.
Also, writing the service in TS does not work either. Changing the file type from ts → js already results in another error message.