<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>227469</bug_id>
          
          <creation_ts>2021-06-28 16:37:57 -0700</creation_ts>
          <short_desc>JavaScript modules fail to load in XHTML documents</short_desc>
          <delta_ts>2025-01-02 10:06:32 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>Safari 13</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=123387</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>00ff0000red</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1773265</commentid>
    <comment_count>0</comment_count>
      <attachid>432441</attachid>
    <who name="">00ff0000red</who>
    <bug_when>2021-06-28 16:37:57 -0700</bug_when>
    <thetext>Created attachment 432441
Example file that reveals the bug

When attempting to load a JavaScript module file (i.e. &lt;script type=&quot;module&quot; src=&quot;...&quot; /&gt;), in an XHTML document sent with the &quot;application/xhtml+xml&quot; MIME type, the file is not loaded at all. It appears that the XHTML document does not recognize &quot;module&quot; as a supported type?

&quot;nomodule&quot; scripts also fail to load, so web applications are unable to provide a reliable fallback due to this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1773301</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2021-06-28 19:04:47 -0700</bug_when>
    <thetext>Chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=717643</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1773315</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2021-06-28 21:28:56 -0700</bug_when>
    <thetext>Currently WebKit does not support modules in XHTML files. You can use modules in HTML (non-XHTML) pages :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1774870</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-07-05 16:38:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/80187406&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2084502</commentid>
    <comment_count>4</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2025-01-02 10:06:32 -0800</bug_when>
    <thetext>This is at least in part the same as the defer case, given the HTML spec defines the lazy processing under &apos;if el has a defer attribute or el&apos;s type is &quot;module&quot;&apos; (https://html.spec.whatwg.org/multipage/scripting.html#:~:text=Otherwise%2C%20if%20el%20has%20a%20%20%20%20%20%20defer%20attribute%20or%20el&apos;s%20type%20is%20%22module%22:).</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>432441</attachid>
            <date>2021-06-28 16:37:57 -0700</date>
            <delta_ts>2021-06-28 16:37:57 -0700</delta_ts>
            <desc>Example file that reveals the bug</desc>
            <filename>bug.xhtml</filename>
            <type>application/xhtml+xml</type>
            <size>275</size>
            <attacher>00ff0000red</attacher>
            
              <data encoding="base64">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGh0bWwgeG1sbnM9Imh0dHA6
Ly93d3cudzMub3JnLzE5OTkveGh0bWwiPgogIDxoZWFkPgogICAgPHRpdGxlPkJ1ZzwvdGl0bGU+
CiAgICA8c2NyaXB0IHR5cGU9Im1vZHVsZSI+CiAgICAgIGNvbnNvbGUubG9nKCJIZWxsbywgd29y
bGQhIik7CiAgICA8L3NjcmlwdD4KICA8L2hlYWQ+CiAgPGJvZHk+CiAgICA8cD5DaGVjayB0aGUg
YnJvd3NlciBjb25zb2xlIGZvciBsb2dzLjwvcD4KICA8L2JvZHk+CjwvaHRtbD4=
</data>

          </attachment>
      

    </bug>

</bugzilla>