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.
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