You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Intermittent TIMEOUT in /preload/modulepreload-sri-importmap.html and /preload/modulepreload-sri.html #43354
changed the title [-]Intermittent TIMEOUT in `/preload/modulepreload-sri-importmap.html`[/-][+]Intermittent TIMEOUT in `/preload/modulepreload-sri-importmap.html` and `/preload/modulepreload-sri.html`[/+]on Mar 18, 2026
This timeout happens when the document is already incorrectly in the Complete ready state. We shouldn't reach that state while there are still deferred scripts pending.
fetch_a_classic_script uses Document::fetch, which uses DocumentLoader::fetch_async_with_callback which adds a blocking load. fetch_a_single_module uses DocumentLoader::fetch_async_with_callback if the module owner is a script element, but modulepreload modules do not use a script element owner.
fetch_a_classic_script uses Document::fetch, which uses DocumentLoader::fetch_async_with_callback which adds a blocking load. fetch_a_single_module uses DocumentLoader::fetch_async_with_callback if the module owner is a script element, but modulepreload modules do not use a script element owner.
I thought DocumentLoader::fetch_async_with_callback shouldn't be used because modulepreloads shouldn't delay the load event.
Yes, I agree. The issue is that the script element loading the module needs to delay the load event, but when it sees there's already matching preload request that doesn't happen.
Activity
yezhizhen commentedon Mar 17, 2026
cc @Gae24
[-]Intermittent TIMEOUT in `/preload/modulepreload-sri-importmap.html`[/-][+]Intermittent TIMEOUT in `/preload/modulepreload-sri-importmap.html` and `/preload/modulepreload-sri.html`[/+]jdm commentedon Mar 18, 2026
jdm commentedon Mar 18, 2026
I reproduced this in a debug build.
jdm commentedon Mar 18, 2026
The timeout occurs when
servo/components/script/script_module.rs
Line 660 in e61298e
servo/components/script/dom/document.rs
Lines 2716 to 2718 in e61298e
jdm commentedon Mar 18, 2026
Relevant spec:
This timeout happens when the document is already incorrectly in the Complete ready state. We shouldn't reach that state while there are still deferred scripts pending.
jdm commentedon Mar 18, 2026
When this occurs, we see:
self.deferred_scripts.take_next_ready_to_be_executed()returns None since the fetch isn't completeI don't see any use of LoadBlocker in htmlscriptelement.rs, and there's
servo/components/script/dom/html/htmlscriptelement.rs
Lines 838 to 839 in e61298e
jdm commentedon Mar 18, 2026
fetch_a_classic_scriptusesDocument::fetch, which usesDocumentLoader::fetch_async_with_callbackwhich adds a blocking load.fetch_a_single_moduleusesDocumentLoader::fetch_async_with_callbackif the module owner is a script element, but modulepreload modules do not use a script element owner.Gae24 commentedon Mar 18, 2026
I thought
DocumentLoader::fetch_async_with_callbackshouldn't be used because modulepreloads shouldn't delay the load event.jdm commentedon Mar 18, 2026
Yes, I agree. The issue is that the script element loading the module needs to delay the load event, but when it sees there's already matching preload request that doesn't happen.
elomscansio commentedon Apr 3, 2026
This is fixed by #43741
#43741 (comment)
yezhizhen commentedon Apr 3, 2026
Gonna open this as the PR not merged yet.
jdm commentedon Apr 3, 2026
@elomscansio Can you add a "Fixes #43354" to that PR's description in that case?
script: implement render-blocking option for script fetch and load ev…