score:0
add a web.config file with following code-
<?xml version="1.0"?>
<configuration>
<system.webserver>
<rewrite>
<rules>
<rule name="react routes" stopprocessing="true">
<match url=".*" />
<conditions logicalgrouping="matchall">
<add input="{request_filename}" matchtype="isfile" negate="true" />
<add input="{request_filename}" matchtype="isdirectory" negate="true" />
<add input="{request_uri}" pattern="^/(api)" negate="true" />
</conditions>
<action type="rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webserver>
</configuration>
score:3
i am able to fix this. the issue is not with react. it is with digitalocean.
i have to set catchall at app spec by doing this
using cloud panel ui: log in and click on app > settings >> click on component name > scroll down to custom page > edit custom page and select catchall > enter index.html in the page name block > save
Source: stackoverflow.com
Related Query
- React JS Application links throwing Error 404 on live server but working on localhost
- React app working locally but application error when deployed to heroku
- React application has "Element type is invalid" error on production, but is working on development
- React Router working on local but not work on real server
- When react application is in production, while refreshing the same routes browser shows 404 error but not in localhost
- Routing not working as per expectation in React on Application Server like tomcat but it works on Node server
- POST request error throwing 404 with node.js server and react app
- React Stripe api not working on live but fine on local
- CORS error when connecting local React frontend to local Spring Boot middleware application
- eslint error on deployment on local server of react web app
- eslint error on deployment on local server of react web app
- Fetch api post call returning 403 forbidden error in React js but the same URL working in postman
- npm run build works fine on local machine but shows error on remote ubuntu server
- Tryning to secure a front End react page with keycloak server but i have this error 'keycloak.init(...).then is not a function'
- I have created a simple node server with CORS enabled. But when I do node server.js, it's throwing error
- React app working on localhost but giving error when deployed either on github or on heroku. No error while deploying
- Asp.net core web application with react template: in development, server checks mvc routes first, but in prodcution the server only returns index.html
- How to set <img /> src dynamically in React without throwing a 404 error at render?
- React throwing an undefined error but only in my JSX
- React ErrorBoundary catches Error but the Error still crashes the application
- Can't get a proxy server working on react app for local mysql database
- React Router Dom Issue - localhost:3000/products to localhost:3000/products/2 is working fine but when I refresh page then I get some error in console
- SSR React Application using loadable library, throws “Cannot convert undefined or null to object” error intermittently on the server for Home Route
- Typescript error on local machine but not on remote test server
- Error While Deploying React application on server
- React import module working in development, but run build causes error
- React Routes not working on Server but work locally
- React app throwing error about key, but I have already assigned a unique key at the top level
- React Router 4 links are working but components are not rendered
- Encapsulate URL to fix 404 error on react js application page when we reload/refresh
More Query from same tag
- material-ui table not displaying data
- React: Unhandled Rejection (TypeError): firebase__WEBPACK_IMPORTED_MODULE_1__
- How to set a value on a specific page template in Gatsby
- how to pass 'auth' or 'profile' object to firestoreConnect() with react-redux-firebase?
- Error: Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & Pick<ClassAttributes<Layout>&Props, "ref" | "key">'
- Error: Element type is invalid:Edit button showing error
- I've problem with react typescript code in .tsx file
- Material ui module not found error... Module not found
- Effectively handle forms in a React functional component
- Blinking Modal with Semantic UI React
- Is it possible to extend the borders of table data <td> to align with content that has been moved via negative margins?
- Javascript merge the values of 4 arrays into one object
- How can i return a JSON object and a zipped folder simultaneously from on end point in spring boot
- React ToDoList Project - Unique IDs
- Time format of videojs
- Redux-form validation based on field in other form
- How to update the display properly in React?
- How to read a nested JSON in React?
- UseEffect not filling all states
- How to make columns in table sortable in both ways using ReactJS
- history object with central Routes file
- Material UI - Switch Button the individual data according to status
- Bootstrap in React.js - Navbar collapse doesn't work
- I got an Error: Objects are not valid as a React child (found: [object Promise])
- How to do the comparison using if inside the render function
- Set camera angle react-three-fiber
- Electron: Unable to load chrome extension in production build
- How to update state when redirecting React Navite?
- React - Using and loading Video files
- Cannot read property 'conversationId' of undefined while using a reducer function