Troubleshooting
This page lists common issues and how to diagnose/fix them when using PubSub MFE.
1. Messages Not Arriving in Other Tabs
Possible causes:
- Transport not attached or failed to connect.
- Channel name mismatch between tabs.
- Browser does not support the preferred transport and fallback isn't configured.
Diagnostics:
- Check adapter
getStats()if available. - Verify the
channelNameis identical across contexts. - Open DevTools and look for transport errors.
Fixes:
- Ensure the adapter is attached with
await adapter.attach(bus). - Use
createAutoTransport()to fall back to supported transports.
2. Duplicate Messages
Possible causes:
- Multiple transports delivering the same message without deduplication.
- Replay from history adapter combined with live delivery.
Diagnostics:
- Check
message.idand compare duplicates. - Enable deduplication in the adapter configuration.
Fixes:
- Enable adapter-level deduplication (deduplication cache and window).
- Filter replays by timestamp or use
schemaVersionto detect replayed formats.
3. Slow Delivery / High Latency
Possible causes:
- Batching interval too long.
- Heavy synchronous handlers blocking the event loop.
- Transport fallback to slower mechanisms (localStorage polling).
Diagnostics:
- Measure latency using
pingmessages (see Performance guide). - Check handler runtimes and move heavy work off the main thread.
Fixes:
- Reduce
batchIntervalMsor disable batching for low-latency needs. - Move heavy computation to Web Workers or backend services.
- Prefer
BroadcastChannelorSharedWorkertransports instead of polling.
4. Schema Validation Failures
Possible causes:
- Schema mismatch between publisher and subscriber.
- Missing
schemaVersionor incorrect payload shape.
Diagnostics:
- Log failing validation errors with the message
idandtopic. - Compare
schemaVersionvalues.
Fixes:
- Add migration handlers to upgrade older schema versions.
- Validate at publish-time and reject malformed messages.
5. Cross-Origin Frame Communication Issues
Possible causes:
- postMessage origin restrictions.
- iframe not granting required permissions.
Diagnostics:
- Check browser console for security errors.
- Inspect
postMessageevent origins.
Fixes:
- Use explicit
targetOrigininpostMessagewhere possible. - Implement an initial handshake between host and iframe to agree on channel names and allowed sources.
When to File an Issue
If you encounter a reproducible bug that you cannot fix, please open an issue with:
- Minimal reproduction steps
- Environment details (browser, version)
- Adapter/transport configuration sample
- Relevant logs or stack traces
See also: Best Practices and Performance Benchmarks.