#ERROR when calling a service factory function

3 messages · Page 1 of 1 (latest)

potent shell
#

We get an error when calling one of the service factory functions:

// in a route.ts file
const appService: MyModuleService = req.scope.resolve(MY_MODULE);

await appService.listInventoryItems();

This is the error.

app:dev: error:   service.list is not a function
app:dev: TypeError: service.list is not a function
app:dev:     at StorrumModuleService.methodImplementation (/packages/core/utils/src/modules-sdk/medusa-service.ts:241:40)

Do you see what is wrong ?

#

ERROR when calling a service factory function

potent shell
#

This seems to be due to the internal service we have. Removing the internal service and only keeping the main service makes the error disappear.

We will keep investigating the root cause of the error.