Skip to content

[Bug]: Missing MIME-type definition for .mjs files causes console errors. #1692

@leandrotijink

Description

@leandrotijink

Platform

Windows

Operating system version

Windows 11 Build 26200.8328

System architecture

Intel (x86)

Herd Version

1.28.0

PHP Version

PHP 8.5.5

Bug description

We are using .mjs files within our project, and the default Nginx configuration doesn't specify a correct MIME-type for these files.

Because the browser enforces strict type checking for module files, you get the error below:
Image.

It's a relatively small problem, fixed by adding the following line to the nginx.conf:
Image

Could this be added by default to Herd installations? It would reduce the modifications we have to make when onboarding team members or reinstalling software.

Steps to reproduce

Include any .mjs file as a module using a script tag.

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions