No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Build Issue : Blank page is displayed after build

    CLI
    2
    2
    585
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jsahoo last edited by jsahoo

      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.

      1 Reply Last reply Reply Quote 0
      • Hawkeye64
        Hawkeye64 last edited by

        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())
        }
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post