EN
React - npm run dev showing "Network: use --host to expose" (Vite)
1 answers
0 points
Previously, when I run npm run dev
command, it showed something like this:
xxxxxxxxxx
1
Local: http://localhost:3000/
2
Network: http://192...:3000/
Now, there is no Network address but the following information instead:
xxxxxxxxxx
1
Network: use --host to expose
I'm using Vite + React + TS. How can I make it work again?
1 answer
0 points
Add the following configuration to the vite.config.ts
file:
xxxxxxxxxx
1
server: {
2
host: true
3
}
Practical example:
xxxxxxxxxx
1
import { defineConfig } from 'vite'
2
import react from '@vitejs/plugin-react'
3
4
export default defineConfig({
5
plugins: [react()],
6
server: {
7
host: true
8
}
9
})
0 commentsShow commentsAdd comment