Replies: 2 comments 2 replies
-
|
@Pacocc97 did you figure it out? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I'm having the same issue. Somebody have solve it? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
Hi, I’m having trouble with event subscribers in MedusaJS. My subscriber is not being triggered when events occur, and I don’t see any logs indicating that the subscriber is being processed.
Setup:
• Medusa version: (your version here)
• Database: (your database, e.g., PostgreSQL, SQLite, etc.)
• Event Bus: Local Event Bus (default) / Redis Event Bus (please specify)
• Running in development mode: pnpm dev
Subscriber Code:
Here is my subscriber that listens for multiple events:
`// src/subscribers/test-order-placed.ts
import type { SubscriberArgs, SubscriberConfig } from '@medusajs/framework';
export default async function testMultipleEventsHandler({
event,
container,
}: SubscriberArgs<{ id: string }>) {
const logger = container.resolve('logger');
logger.info(
EVENT DETECTED: ${event.name} with data:);console.log(
EVENT DETECTED: ${event.name} with data:, event.data);}
export const config: SubscriberConfig = {
event: [
'product.created',
'user.created',
'user.updated',
'order.placed',
'order.updated',
'order.completed',
'order.refunded',
'order.canceled',
'order.fulfilled',
'payment.captured',
'cart.created',
'cart.updated',
'delivery.created',
'shipment.created',
],
};`
Troubleshooting Steps Taken:
1. Restarted the Medusa server (pnpm dev).
2. Verified the subscriber is inside src/subscribers/.
3. Confirmed that the correct events are being emitted.
4. Tried adding logs but nothing is being printed.
5. Checked logs for event processing, but I don’t see any “Processing event.name” logs.
6. Tried listening for common events like order.placed and product.created, but none of them trigger the subscriber.
Expected Behavior:
• The subscriber should log messages when an event occurs.
Actual Behavior:
• No logs appear, and it seems like no events are being processed.
Question:
Is there anything I might be missing in my setup? Are there known issues with event subscribers in the latest version of Medusa?
Thanks in advance for your help! 🙏
Beta Was this translation helpful? Give feedback.
All reactions