Skip to content

Mime-type warning in Firefox #39

@jnaklaas

Description

@jnaklaas

I use the v3 plugin with webpack. The Firefox browser console throws a warning stating my js is loaded, but has a wrong mime-type: Het script van ‘http://localhost:3000/’ is geladen, hoewel het MIME-type ervan (‘text/html’) geen geldig JavaScript-MIME-type is.

The warning translates to The script is loaded, although its MIME-type (‘text/html’) is not a valid JavaScript-MIME-type.

The .babelrc:

{
  "presets": [ "@babel/preset-env"],
  "plugins": [
    ["babel-plugin-inline-import", {"extensions": [".html"]}]
  ]
}

The javascript:

import html from './template.html';
console.log(html);

My code works. Webkit browsers don't show this warning, Firefox does though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions