Blocked request. This host ("xx.xxxxx.xx") is not allowed.
To allow this host, add "xx.xxxxx.xx" to server.allowedHosts
in vite.config.js.
Blocked request. This host ("xx.xxxxx.xx") is not allowed.
To allow this host, add "xx.xxxxx.xx" to server.allowedHosts
in vite.config.js.
1 Answer
Reset to default 0This is happening because of changes in Vite v6.1.0
. One can fix this issue with following config changes inside src/admin/config/vite.config.js
file (if you are using Strapi or your vite config file if using vite somewhere else). The file should look like as given below.
Note: Don't fet to build project again i.e. run yarn build
or npm run build
command.
const { mergeConfig } = require("vite");
module.exports = (config) => {
// Important: always return the modified config
const allowedHosts = ['localhost','127.0.0.1','youdomain'];
return mergeConfig(config, {
resolve: {
alias: {
"@": "/src",
},
},
server: {
allowedHosts
}
});
};