react native 404 not found while using deployed endpoint - reactjs

I'm using React Native to work on my project. The problem I'm facing: it is working perfectly 200 ok while fetching data locally but, when I try to use after deployment it says 404 not found.
What could be the reason?

A 404 error is an HTTP status code that means that the page you were trying to reach, couldn't be found on their server.

Related

Next.js - local build works fine, production build deployed to GCP w/ Cloud Run has Minified React errors

Newish to Next.js. I deployed a Next app to GCP with Cloud Run. The local build runs with with no errors or warnings but I'm getting Minified React errors 419 and 425 on production.
I looked at the full error message but I'm not sure how to debug my code since my local build works fine.
I'm grabbing half a dozen collections from a Firestore db in a getStaticProps() and subscribing to two collections with onSnapshot in a useEffect() hook.
Any thoughts?
I could try grabbing everything in a useEffect (ditching the getStaticProps) but that seemed like the place to do my data fetching since it's a simple SPA with static data that doesn't change much.
The 400s error that you have mentioned generally means that the client is not in the capacity to complete a request.
The error “419” Indicates that you're missing your CSRF token from your request; you may fix this by adding the token when it is generated in the headers token variable and without the CSRF-token the endpoint will return the 419 status response.
Next,the error “425” indicates that when using Server-Side Rendering (SSR) with a framework like NextJS, it is uses React hydration, which basically means React is figuring out how to take the DOM structure rendered from the HTML file and convert it into a running single-page app (SPA),for this to work correctly, React Hydration requires that the HTML from the server and what your client-side app renders are an EXACT match.
I would recommend you to rectify these in your source code and try to deploy the build again.
Also check out these links for more information and examples:
Error Decoder - 425
Error Decoder - 419
Error text content does not match
419 page expired CSRF token

React app doesn't get API results after deploying to Heroku

I did basic movie database type app with React and then deployed it to Heroku. App contains input field and it returns results after pressing Enter, and this works just fine locally. My problem is when I deployed my app to Heroku nothing happens anymore when I hit Enter and trying to search something. I belive app works correctly but for some reason it doest't get data from API when app is deployed to Heroku. Any ideas what causing this problem and how to fix this?
Source code
Live demo
Mixed Content: The page at 'https://reactmoviedb.herokuapp.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.omdbapi.com/?apikey=bf410ecf&s=dfvdf'. This request has been blocked; the content must be served over HTTPS.
The error your are getting
ReactJS API Data Fetching CORS error

React/Github-pages: Failed to load resource: the server responded with a status of 404 ()

I have successfully uploaded react app`s to github pages before, but this time when I try to upload a new page the code is pushed and everything looks fine in the repository, everything loads fine in the localhost. The problem is when I access the website in the console i get the error message above.
const res = await axios.get(' https://api.open5e.com/monsters/?limit=1086');
I am using this API, the limit is above 50 but I don`t believe this is the reason for the crash but I cannot think of anything else.
Website 1: (Currently redirects you to a 404 error page, as part of my attempt to solve the problem)
https://ottotsuma.github.io/MonsterSearch/
Repo - Website 1:
https://github.com/ottotsuma/MonsterSearch
Website 2:
https://ottotsuma.github.io/MonsterApiReact/
Repo all code:
https://github.com/ottotsuma/DnD-React
I also get this error in localhost and the hosted website: Uncaught TypeError: Cannot use 'in' operator to search for 'default' in undefined. But since the website was working as intended so far I have just ignored it.
I was hoping if anyone else has had a similar problem with gh-pages they might know what I have done wrong.
Kind regards,
Sheep

OAuth GitHub Authentication from single page React app

I'm trying to integrate my single page React app with GitHub.
I successfully run first stage of authentication, i.e. receiving redirect with code from https://github.com/login/oauth/authorize
The problem is the second part, i.e. POST to https://github.com/login/oauth/access_token
I can't do POST or GET from my web page itself via JavaScript or JQuery. Using $.ajax or $.post all end up with error Access-Control-Allow-Origin.
The app was created with create-react-app and run with npm start.
How can I avoid Access-Control-Allow-Origin error in my scenario? Is there a way to get GitHub token for GitHub API in some other way?
I've tried to do POST with , and it does not complain on Access-Control-Allow-Origin. In fact after .submit() I receive expected response (as per https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) but it comes as a file, which Chrome immediately downloads.

angular2-sails 404 error (not found)

I am having difficulty hooking up my sql server with a front end of angular 2.
I ran the sailsjs getting started guide
I then hooked up angular2 with sails. I followed the sharpten guide
http://sharpten.com/blog/2016/02/02/integrating-angular-2-with-sails-js.html
I then used the sails-sqlserver package to connect to my localhost sql server
sails-sqlserver
I have the sails returning my data and now i want to use angular 2 to interact with the data.
I found the angular2-sails package.
https://www.npmjs.com/package/angular2-sails
However, I am getting a 404 error with the angular2-sails package
ERROR:
zone.js:1382
"GET http: //localhost:1337/node_modules/angular2-sails/ 404 (Not Found)"
How do i get rid of this 404 error?
Thanks.
I got this to work with version 0.1.4 of angular2-sails.
i commented out the sailsmodule due to version 0.1.4 just having the SailsService
//import {SailsModule} from "angular2-sails";
In my component I imported the SailsService
import {SailsService} from "angular2-sails/dist/index";

Resources