Saturday, April 20, 2024
HomeCSScss - Refused to use model as a result of its MIME...

css – Refused to use model as a result of its MIME kind (‘textual content/html’) will not be a supported and to load bundle.js file


These are the error messages I am getting:

    Refused to use model from 'http://localhost:3000/search_window/min/dist/bundle.css' as a result of its MIME kind ('textual content/html') will not be a supported stylesheet MIME kind, and strict MIME checking is enabled.
    localhost/:1 Refused to use model from 'http://localhost:3000/search_window/min/ext/icons/iconfont.css' as a result of its MIME kind ('textual content/html') will not be a supported stylesheet MIME kind, and strict MIME checking is enabled.
    bundle.js:1 
     Didn't load useful resource: the server responded with a standing of 404 (Not Discovered) localhost/:1 Refused to use model from 'http://localhost:3000/search_window/min/dist/bundle.css' as a result of its MIME kind ('textual content/html') will not be a supported stylesheet MIME kind, and strict MIME checking is enabled.
    localhost/:1 Refused to use model from 'http://localhost:3000/search_window/min/ext/icons/iconfont.css' as a result of its MIME kind ('textual content/html') will not be a supported stylesheet MIME kind, and strict MIME checking is enabled." 

enter image description here
enter image description here

In package deal.json :

         "mainConfig": "./webpack.most important.config.js",
        "devContentSecurityPolicy": "default-src 'unsafe-eval' 'self'; script-src-elem 'self' 'unsafe-inline'; img-src *; style-src 'self' 'unsafe-inline'; font-src 'self' https://static2.sharepointonline.com; connect-src 'self' https: http:",
        "renderer": {
          "config": "./webpack.renderer.config.js",
          "entryPoints": [
            {
              "html": "./src/app_S/index_S.html",
              "js": "./src/app_S/renderer_S.ts",
              "css": ["./src/app_S/min/dist/bundle.css", "./src/app_S/min/ext/iconfont.css"],
              "preload": {
                "js": "./src/most important/preload/preload.ts"
              },
              "title": "search_window"

In /src/app_S/index_S.html :

And in app_S/min/dist :

-rw-rw-r--  1 raphy raphy 354K set 30 19:51 construct.js
-rw-rw-r--  1 raphy raphy  41K set 30 19:51 bundle.css
-rw-rw-r--  1 raphy raphy 915K set 30 19:51 bundle.js
-rw-rw-r--  1 raphy raphy 349K set 30 19:51 localization.construct.js
-rw-rw-r--  1 raphy raphy  28K set 30 19:51 preload.js 

The bundle.css is obtained by this script app_S/min/scripts/buildBrowserStyles.js :

const path = require('path')
const fs = require('fs')

const outFile = path.resolve(__dirname, '../dist/bundle.css')

const modules = [
  '../../../src/assets/css/base.css',
  '../../../src/assets/css/windowControls.css',
  '../../../src/assets/css/modal.css',
  '../../../src/assets/css/tabBar.css',
  '../../../src/assets/css/tabEditor.css',
  '../../../src/assets/css/taskOverlay.css',
  '../../../src/assets/css/webviews.css',
  '../../../src/assets/css/newTabPage.css',
  '../../../src/assets/css/searchbar.css',
  '../../../src/assets/css/listItem.css',
  '../../../src/assets/css/bookmarkManager.css',
  '../../../src/assets/css/findinpage.css',
  '../../../src/assets/css/downloadManager.css',
  '../../../src/assets/css/passwordManager.css',
  '../../../src/assets/css/passwordCapture.css',
  '../../../src/assets/css/passwordViewer.css',
  '../../../node_modules/dragula/dist/dragula.min.css'
]

operate buildBrowserStyles () {
  /* concatenate modules */
  let output=""
  modules.forEach(operate (script) {
    output += fs.readFileSync(path.resolve(__dirname, '../', script)) + 'n'
  })

  fs.writeFileSync(outFile, output, 'utf-8')
}

if (module.dad or mum) {
  module.exports = buildBrowserStyles
} else {
  buildBrowserStyles()
}

which is run in the course of the constructing section:

in package deal.json :

"scripts": {
  "watch": "node ./src/app_S/min/scripts/watch.js",
  "buildMain": "node ./src/app_S/min/scripts/buildMain.js",
  "buildBrowser": "node ./src/app_S/min/scripts/buildBrowser.js",
  "buildBrowserStyles": "node ./src/app_S/min/scripts
/buildBrowserStyles.js",
  "buildPreload": "node ./src/app_S/min/scripts/buildPreload.js",
  "construct": "yarn run buildMain && yarn run buildBrowser && yarn run
 buildBrowserStyles && yarn run buildPreload",
"begin": "yarn run construct && concurrently "yarn run watch" 
"electron-forge begin --inspect-electron"",

In webpack.guidelines.js:

  {
    check: /.css$/i,
    kind: 'asset', // https://github.com/webpack-contrib/postcss-loader/points/580#issuecomment-1130126061
    use: [
      {
        loader: "style-loader"
      },
      {
        loader:  "postcss-loader"
      },
      {
        loader: "css-loader"
      }
    ],
    //generator: {
      //outputPath: '.webpack/property/css/'
    //},
  },

It appears to me that the recordsdata paths are right…
What might be the causes for not making use of the model and for not loading the bundle.js file? Trying ahead to your variety assist

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments