score:0
react apps built using create-react-app
will only run when served using http.
you can try npx http-server
in your build folder and visit localhost:8080
score:0
you can make an index.html like this:
<html>
<body>
<div id="root"></div>
</body>
<script type="text/javascript" src="bundle.js"></script>
</html>
actually this is the real way you do it when you build your app for production and want it to serve. the method @aghardeshir has suggested is for development purpose. once your build is ready, you can serve it through a local server(like node or xampp) or just test it by opening it in a browser.
Source: stackoverflow.com
Related Query
- create react app - npm run build issues
- Running npm run build in Heroku to serve a flask backend react frontend app
- npm run build does not update the react components
- no service-worker.js file after npm run build in react
- How do I resolve the React app error for npm run build "Failed to compile. Failed to minify the bundle."?
- NPM run build with React + Node + concurrently How to?
- npm run build on my react app gives error => (Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out out of memory)
- How to add async attribute to script generated by react scripts (at the npm run build stage on the create-react-app template)
- React blank page after running npm run build because of react-router-dom
- Unable to build react app using npm run build - Exit status 1
- React npm run build - Must use import to load ES Module error
- I am not getting home component in react website after npm run build command I am only getting Navbar and Footer
- React Typescript ERROR when running npm run build with webpack
- SyntaxError in npm run build / React
- React app changes not updaiting after running npm run build
- npm ERR! code ELIFECYCLE when running npm run build command for react
- White Screen after npm run build React
- React app docker container exits/restarts after executing npm run build command
- white screen after using npm run build react app
- npm start & npm run build not working | React App
- is there any way to run React + Django in same project without running npm run build again and again?
- Why won't React production build run on the browser?
- create-react-app npm run build command
- Missing Script when I run npm start to create React app
- Is it possible to run React project without npm start?
- Why Code Coverage in react app is empty? Tried using npm run test -- --coverage. But always showing empty code coverage
- React build run on server using pm2
- react.js - running npm run build with custom paths
- How to run React JS build in React-Native Webview?
- Run npm build with specific .env file
More Query from same tag
- Mapbox Popup only opens once and never again
- I had to graph income and expenses, wanting only the current year to graph. React sequelize
- How to fix this Syntax Error in my React App?
- Hover over div/image to fade out image and have text fade in, but hovering over text removes fade out of image. How to prevent?
- React Router v4 Navigate from MobX store action?
- Modify array of objects in Redux depeding on condition
- How to hide null values during render in React?
- Data Response Not able to map in the react router
- What is the difference in redirect from '/' and '/anything' in react-router?
- How to add dropdown to react-table on click of icon
- Bootstrap breadcrumb not working correctly in RTL mode
- Is there a way to prevent toggling of input text when hiding an element
- React router V6 only working for root path
- How can I access the props for a nested component in React?
- How to delete chips in Material UI
- How to hide url by react-router, so component should not be visible
- Use component onClick
- on click i want to generate alert in react js method
- Reactjs - Higher Order Component unmount not working correctly
- How can I solve: "Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null."
- React, JS - best practices for setState()
- change color on material ui select doesn't work, ReactJS
- reactjs event listener window.resize
- My mock function are not called after simulate change input type=file
- Why after onClick my state is undefined ? [Hook, React]
- How to pass key to react component
- How do I use an Immutable.js List of objects in React with Typescript?
- How to pass an input to Redux store and map filtered data accordingly
- Selector data is loaded correctly from the redux store, but not displayed by the calling page component
- React - TypeError: Cannot read properties of undefined (reading 'params')