• Home
  • Plugins
    • BSK PDF Manager
    • BSK Forms Blacklist
    • BSK Forms Validation
  • Documentations
    • BSK PDF Manager
    • BSK Forms Blacklist
    • BSK Forms Validation
  • Blog
  • Contact Us
  • Your Account
    • Purchase History
    • Checkout

How to add MIME-Type for extension mjs?

The .mjs file extension stands for "module JavaScript." It was introduced as part of the ECMAScript 6 (ES6) module system. ES6 modules provide a standardized way to organize and share JavaScript code across multiple files and projects. Before ES6 modules, JavaScript didn't have a built-in system for managing dependencies, resulting in developers relying on external libraries like CommonJS or AMD.

You will see the below error because some server doesn't have a MIME-Type for .mjs file.

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of

How to add MIME-Type in cPanel

There's Mime Types icon in Advanced section in cPanel as the below screenshot.

 

Open the mime types page and you'll see form to let you add mime types as the below screenshot.

Enter application/javascript to MIME Type field and mjs to Extension(s) field.

After adding, it will be listed in User Defined MIME Types area.

It may need 5 minutes or more to let the new MIMEType work as there's cache. Suggest you to clear browser's cache before you refresh the browser to test again.

How to add MIME-Type to Apache

You need open the config file of httpd.conf, you'll see mime_module in the config file as the below.

Just add AddType text/javascript .mjs to the end of the module.

It needs to restart Apache after change the httpd.conf file. Suggest you to clear browser's cache before you refresh the browser to test again.

 

If you don't know how to add mime type , you may contact your hosting support for help.

 

 

Purchase BSK PDF Manager Pro

FAQ

  • How to upgrade BSK PDF Manager from Older Versions to the Latest Version
  • How to make PDFs load the PDF image (icon)
  • Is there a way that don't leave as much space below each line?
  • How to remove the border around PDF image?
  • How to make the pdf titles smaller when display in columns layout?
  • How to add MIME-Type for extension mjs?
  • About PDF / document status
  • Licensing
  • Refund Policy
  • Affiliate Area

 

Copyright © 2025 BannerSky

BannerSky