Bug 227469 - JavaScript modules fail to load in XHTML documents
Summary: JavaScript modules fail to load in XHTML documents
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 13
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-28 16:37 PDT by 00ff0000red
Modified: 2021-07-05 16:38 PDT (History)
4 users (show)

See Also:


Attachments
Example file that reveals the bug (275 bytes, application/xhtml+xml)
2021-06-28 16:37 PDT, 00ff0000red
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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>