Why can't we roll this Blocked request error back?

Blocked request. This host (“”) is not allowed.
To allow this host, add “” to server.allowedHosts in vite.config.js.

I spent $ with agent going around and around and around trying to fix this.

Instead of spending my typical budget today I’m waiting on a support email. Give users the ability to programmatically solve this error.

I could move to my previously forked version but I have a pretty big feature that I don’t want to recreate.

We shipped a fix for this recently to help agent identify the right place for this. Probably the issue is that the vite.config.js is for the client, the server has a config in vite.ts that it uses, you need to add allowedHosts: true to that vite.ts’ server config . Agent picks up the vite.config.js first before it goes into server’s directory so it gets tripped up. There’s an explicit fix for this shipped now so should not happen on new repls.

Thanks Kody, it’s wild it was that easy but I understand the security measure

Maybe reply to this kind of post with answers enhanced for the non-programmer also. The last reply was Latin to me.

1 Like

Mark, my bad I should have shared that I clicked on the vite.ts file on the left-hand panel that contains the files and found the lines below starting on line 36 (your code may be on a different line). The corrected code has " allowedHosts: true," added as a line.

server: { middlewareMode: true, hmr: { server },

<this is the final fix, notice the extra line of code>
server: {
middlewareMode: true,
allowedHosts: true,
hmr: { server },
</this is the final fix, notice the extra line of code>

Thanks for the question

Just ask the Assistant to “Add allowedHosts: true to the vite.ts for the server config”