Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script type="module" not support,when upgrade to 4.80.1 #7496

Open
ahjszll opened this issue Jan 15, 2025 · 0 comments
Open

script type="module" not support,when upgrade to 4.80.1 #7496

ahjszll opened this issue Jan 15, 2025 · 0 comments

Comments

@ahjszll
Copy link

ahjszll commented Jan 15, 2025

nopCommerce version: 4.80.1

  1. *.cshtml
<script type="module" src="/Themes/mytheme/Content/js/model-viewer.min.js"></script>
<script type="module" src="/Themes/mytheme/Content/js/zoom.js"></script>
  1. but,edge browser,display source code
 <script src="/Themes/mytheme/Content/js/model-viewer.min.js"></script>
<script src="/Themes/mytheme/Content/js/zoom.js"></script>
  1. can i change the code :
    src/Presentation/Nop.Web.Framework/TagHelpers/Shared/NopScriptTagHelper.cs
if (!output.Attributes.ContainsName("type")) // we don't touch other types e.g. text/template
      output.Attributes.SetAttribute("type", MimeTypes.TextJavascript);

to

 if (!context.AllAttributes.ContainsName("type")) // we don't touch other types e.g. text/template
     output.Attributes.SetAttribute("type", MimeTypes.TextJavascript);

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants