I am so sorry for not sending the error and saying exact details about the situation.
The problem is behind in hmr, when i put the domain address or ip, it will request to server that exact host name ( rathar than it should be dynamic that client load the server ).
For example I want to load website with another domain but it just load what EXACTLY I put in host: "0.0.0.0".
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://0.0.0.0:5173/@vite/client. (Reason: CORS request did not succeed). Status code: (null).
Now if I load website locally it will shows CORS Error because it is not pointed to domain name ( or ip address )
But don't understand it why, because if i don't put anything in host: "localhost" and instead use npm run dev -- --host to run vite server without saying what the hostname is, it shows this CORS Error.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://[::]:5173/@vite/client. (Reason: CORS request did not succeed). Status code: (null).
So the only thing I can do is to when i wanted to use it globally ( through internet ) i should put my domain name or public ip otherwise i should localhost to switch server to local computers to load website assets.
I am truly sorry if I misunderstood what is happening.