NEW227469
JavaScript modules fail to load in XHTML documents
https://bugs.webkit.org/show_bug.cgi?id=227469
Summary JavaScript modules fail to load in XHTML documents
00ff0000red
Reported 2021-06-28 16:37:57 PDT
Created attachment 432441 [details] Example file that reveals the bug When attempting to load a JavaScript module file (i.e. <script type="module" src="..." />), in an XHTML document sent with the "application/xhtml+xml" MIME type, the file is not loaded at all. It appears that the XHTML document does not recognize "module" as a supported type? "nomodule" scripts also fail to load, so web applications are unable to provide a reliable fallback due to this bug.
Attachments
Example file that reveals the bug (275 bytes, application/xhtml+xml)
2021-06-28 16:37 PDT, 00ff0000red
no flags
Alexey Proskuryakov
Comment 1 2021-06-28 19:04:47 PDT
Yusuke Suzuki
Comment 2 2021-06-28 21:28:56 PDT
Currently WebKit does not support modules in XHTML files. You can use modules in HTML (non-XHTML) pages :)
Radar WebKit Bug Importer
Comment 3 2021-07-05 16:38:17 PDT
Sam Sneddon [:gsnedders]
Comment 4 2025-01-02 10:06:32 PST
This is at least in part the same as the defer case, given the HTML spec defines the lazy processing under 'if el has a defer attribute or el's type is "module"' (https://html.spec.whatwg.org/multipage/scripting.html#:~:text=Otherwise%2C%20if%20el%20has%20a%20%20%20%20%20%20defer%20attribute%20or%20el's%20type%20is%20%22module%22:).
Note You need to log in before you can comment on or make changes to this bug.