Vite Server is running but not working on localhost

vite.config.ts

import {defineConfig} from 'vite'
import react from '@vitejs/plugin-react'
import dns from 'node:dns'

dns.setDefaultResultOrder('verbatim')

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [react()],
    server: {
        host: '127.0.0.1'
    }
})

References
https://stackoverflow.com/questions/70694187/vite-server-is-running-but-not-working-on-localhost
https://vitejs.dev/config/server-options.html#server-host