Build Issue : Blank page is displayed after build



  • 0_1532021327498_Error_MSG.PNG Hi,
    I am new to quasar I tried Building the app using quasar build on click of index.html in HTTP server, shows up a blank page with following error :

    index.html:1 Refused to execute script from ‘http://localhost:63343/js/vendor.ea436cd5.js’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled.
    Build was successful with no error.

    Could anyone please tell what I am doing wrong.



  • If you are using Node/express as your backend, use the cors package as middleware for express. It’s because your ports are not matching. I usually use the following for my express:

    // Setup middlewares
    const bodyParser = require('body-parser')
    const compression = require('compression')
    const helmet = require('helmet')
    const cors = require('cors')
    
    module.exports = (app) => {
      app.use(compression())
      app.use(bodyParser.json())
      app.use(bodyParser.urlencoded({ extended: true }))
      app.use(helmet())
      app.use(cors())
    }