Bug 227469

Summary: JavaScript modules fail to load in XHTML documents
Product: WebKit Reporter: 00ff0000red
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: cdumez, webkit-bug-importer, youennf, ysuzuki
Priority: P2 Keywords: InRadar
Version: Safari 13   
Hardware: All   
OS: All   
Attachments:
Description Flags
Example file that reveals the bug none

Description 00ff0000red 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.
Comment 1 Alexey Proskuryakov 2021-06-28 19:04:47 PDT
Chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=717643
Comment 2 Yusuke Suzuki 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 :)
Comment 3 Radar WebKit Bug Importer 2021-07-05 16:38:17 PDT
<rdar://problem/80187406>