Hi @sonic current and @surreal pelican ! I just followed your conversation and it helped me a lot, but I got an unexpected error when creating the product on the admin website. It looks like the event is well triggered but the obj is not created on the strapi site with the below error.
This is Strapi log error:
[2023-03-21 19:45:42.482] http: GET /api/products (57 ms) 200
[2023-03-21 19:45:42.772] error: Cannot read properties of undefined (reading 'response')
TypeError: Cannot read properties of undefined (reading 'response')
at Object.create (C:\helios-strapi\src\api\product\controllers\product.js:36:38)
at dispatch (C:\helios-strapi\node_modules\koa-compose\index.js:42:32)
at returnBodyMiddleware (C:\helios-strapi\node_modules\@strapi\strapi\lib\services\server\compose-endpoint.js:52:24)
at dispatch (C:\helios-strapi\node_modules\koa-compose\index.js:42:32)
at policiesMiddleware (C:\helios-strapi\node_modules\@strapi\strapi\lib\services\server\policy.js:24:11)
at dispatch (C:\helios-strapi\node_modules\koa-compose\index.js:42:32)
at C:\helios-strapi\node_modules\@strapi\strapi\lib\services\server\compose-endpoint.js:33:12
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async C:\helios-strapi\node_modules\@strapi\strapi\lib\middlewares\body.js:58:9
at async C:\helios-strapi\node_modules\@strapi\strapi\lib\middlewares\logger.js:25:5
And this is the log from the Medusa server:
info: Processing product.created which has 2 subscribers
warn: An error occurred while processing product.created: Error: Error while trying to create entry in strapi - products