A recent change in one of the Quasar dependencies, potentially vite, which is now at version 6.0.11, has led to the following error:

1
2
Blocked request. This host ("frontend") is not allowed.
To allow this host, add "frontend" to `server.allowedHosts` in vite.config.js.

This will likely differ slightly on your own machine, as I am running in Docker, but this is very simple to fix.

As Quasar does not use vite.config.js, you will need to define a new key in the Quasar config, e.g. quasar.config.ts.

Open the file in your editor, scroll down to devServer, and add an array of host names there, e.g.

1
2
3
4
5
6
    devServer: {
      // https: true,
      open: false,
      // Replace this with your own hostnames
      allowedHosts: ["frontend"],
    },

Save the file, reload the browser, and Vite should be happy again.

Jan. 21, 2025, 8:15 p.m.

Tags

Quasar Vue.js