score:8
Accepted answer
it turns out that i needed to configure host
to something other than localhost
.
within vite.config.ts
:
import { defineconfig } from 'vite'
import reactrefresh from '@vitejs/plugin-react-refresh'
// https://vitejs.dev/config/
export default defineconfig({
server: {
host: '0.0.0.0',
port: 3000,
},
plugins: [reactrefresh()],
})
resolves the issue.
score:2
in package.json use script
"dev": "vite --host"
example:
"scripts": {
"dev": "vite --host",
"build": "tsc && vite build",
"serve": "vite preview"
},
or run with vite --host
Source: stackoverflow.com
Related Query
- Unable to Dockerize Vite React-Typescript Project
- Unable to add typescript to a react project
- Unable to create React typescript project
- What is the react-app-env.d.ts in a react typescript project for
- How to organize types definitions in a React Project w/ Typescript
- setting up ts-jest for react typescript project
- Absolute path not working in Vite project React TS
- Unable to run "ANY" react native example project
- Unable to run React Native Project on simulator after updating to Xcode 12
- Connecting a component with OwnProps using react redux and typescript in the .NET Core 2.0 reactredux template project
- Typescript and React (with Gatsby loader): unable to import images as modules
- Could not find a required file. - Adding TypeScript to React project
- Typescript Errors while converting a React project
- Typescript in a React project is no longer recognizing the 'as' keyword
- React native Typescript path alias unable to resolve module
- I would like to use TypeScript and React in Laravel Project
- Store/retrieve config settings in React project with Typescript
- Unable to run react js project
- enable hot reload for vite react project instead of page reload
- Unable to start React with TypeScript in Docker container
- Correct way of working with SVG in a TypeScript React project with ESlint
- Unable to create react project - operation not permitted
- Why is node.js unable to locate other typescript React components
- Unable to install or update packages for React project
- Disadvantages of making all TypeScript in a project using React with .tsx
- Sharing code between a Typescript React project and a Typescript Express project
- How using types.d.ts file in React & TypeScript project
- prevent asking "Missing JSDoc comment" for standard react methods in typescript project
- tsx extension error in React project with Typescript
- Unable to copy bundle.js of a React project to Spring Project using webpack
More Query from same tag
- Lifecycle - fetch data only after loading complete
- React Hook not opening form onClick
- cannot get the text box values from react
- All dropdown rows open on click
- children component value reset when reload page in react
- How do you access match in a React-Redux container?
- Any way to NOT pack with Webpack/React?
- Is there a way to map a value of a response from an API in React to some predetermined values, which would then determine what is rendered?
- NextJs / Framer Motion: When using useViewportScroll I got this warning: Warning: useLayoutEffect does nothing on the server,
- chartjs doesn't render dates properly
- React useEffect isn't getting data from firestore
- Redux saga in shadow dom in multiple tabs, only run once
- The action menu is not getting closed even if I click somewhere on page, the menu remains open until I explicitly click on the Action button again
- React: set the state based on array values
- React Typescript createContext types issue
- How to keep dropdowns and buttons fixed while panning on a google-map
- Show react component based on conditions
- how to send dynamic props in react
- TypeScript checking in React Functional components
- Antd Table render properties inside and array of objects
- React and bootstrap: component not rendering
- uploadcare is undefined in reactjs app
- How to finish all fetch before executing next function in React?
- React images caption error from api maybe to do with correct Index
- How to check if else conditions containing window.location.href (React Component) using Jest
- How to navigate after submit radio form in ReactJs
- How to play actions in a threejs object, loaded with useGLTF and showed with react three fiber
- passing regex to path prop of Route works with warning
- react-hook-form when editing doesn't update
- useEffect runs prior to rendering?