Because the user and site modules simply have mw.loader.state( 'modulename', 'ready' ); injected at the end, a JS error in user-authored code causes that statement to never be reached, and the module state to remain set to 'loading' indefinitely. There is no code setting it to 'error' anywhere. Consequently, the promise returned by mw.loader.using( 'user' ) is never rejected, it can only be resolved (in the no-error case) or remain pending forever (in the error case).
|Resolved||Krinkle||T106736 "Site" and "user" module (legacy only=scripts requests) stay pending indefinitely if script causes error|
|Resolved||Krinkle||T32358 Support loading legacy "site" and "user" modules with mw.loader|
- Mentioned In
rMWafce927c8fad: resourceloader: Ensure 'user' loads after 'site' (asynchronously)
rMW19a40cd3ad58: resourceloader: Implement support for 'site' into mw.loader
T105363: Catch errors thrown in site module (MediaWiki:Common.js, etc.)
- Mentioned Here
- T107399: Make top queue fully asynchronous
This now works as expected (per T107399). When site or user module throws an exception at run-time, these are caught (without affecting the call stack) and state becomes "error". VE loads correctly thanks to its use of .always() and ResourceLoader's promise now actually being fulfilled.
Exception in module-execute in module user:
(X) My error