Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
// Express - you have to set static folder
// Make a folder called public
const express = require('express');
const app = express();
const path = require('path');
app.use(express.static(path.join(__dirname, 'public')));A simple workaround:
config.js
export default
{
// my json here...
}
then...
import config from '../config.js'
does not allow import of existing .json files, but does a job.
Also in JavaScript:
- javascript find the longest string in array
- js escape url parameter
- how to push mutual array elements in an array nested loop javascript
- on success replace class div ajax
- p5 js lines
- new features of angular 11
- clear input field jquery
- react hook form submit outside form
- c# beautify json string
- jquery clear file input
- js replace all symbols in string
- reverse a linked list js
- npm react native turn by turn navigation
- drupal tag filter ajax content
- push javascript
- date object javascript
- mongoose nullable
- rotate a div using javascript
- printf statement in javascript
- javascript location redirect
- how to create a smooth effect in javasript
- cypress fixture
- how to add multiple comment in react
- jest axios manual mock