raghavendra1207
Aug 29, 2025Copper Contributor
Status:
New
Feature Request: Add error/rejection support to Office.onReady() for network/dependency failures
Description
Currently, when Office.js loads but one of its dependent resources (such as office_strings.js) fails to load due to network issues or blocking, the Office.onReady() promise never resolves or rejects. This leaves developers without a reliable way to detect missing dependencies.
Instead of relying on timeouts or log messages, it would be very helpful if Office.onReady() provided an error callback or rejection in these scenarios.
Why this matters:
- Helps developers handle production failures gracefully.
- Avoids arbitrary timeouts/workarounds to detect missing dependencies.
- Provides parity with modern async practices where promises resolve or reject deterministically.
- Enables better telemetry/analytics by explicitly knowing why initialization failed.
Suggested Approach:
- If a required dependency fails to load, Office.onReady() should reject with an error describing the missing dependency.
- Alternatively, provide an event/callback (e.g., Office.onError) that developers can subscribe to.
Example:
Office.onReady()
.then(info => {
console.log("Office.js initialized:", info);
})
.catch(err => {
console.error("Office.js failed to initialize:", err);
// custom fallback handling
});
Impact:
This would improve developer experience significantly and make add-ins more resilient in real-world network environments.
No CommentsBe the first to comment