IN FIREFOX: When I execute my code the typical error I should get is: "TypeError: Cannot read property 'setState' of undefined", instead I received a very weird cross-origin error.
Here is a screenshot of the error: http://prntscr.com/iwipnb
Error A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/docs/cross-origin-errors.html for more information.
here is my code: https://codesandbox.io/s/4885l37xrw
How can I avoid the cross-origin error in Codesandbox in FIREFOX?
EDIT1: I know what is the code bug (bind(this)). I'm looking for the cross-origin error firefox problem. Thanks
set the request's mode to 'no-cors' to fetch the resource with CORS disabled. It states that there's a missing Access-Control-Allow-Origin header on the resource you requested.
There are several ways we can overcome this issue: Make REST API calls from the same domain as xkcd. Edit the CORS settings of xkcd's server. Make REST API calls from our own backend server.
To save your projects and forks, you will want to create a GitHub account and sign in. There is a sign-in button located on the very top right. This way you'll be able to save your sandboxes. You can click a button on the left panel to get a list of sandboxes saved under your account.
Download files directly from CodeSandbox CodeSandbox has a super handy download button on the menu bar in the top left-hand corner. Click this button to download all the files and folders from CodeSandbox to a ZIP file. Extract the ZIP file and copy the files into your project.
I have my server setup to support CORS and it's still giving me this error.
It looks like an issue with ReactJS
if there is an error while processing a response from the server. In my case it was happening while trying to parse invalid response into JSON
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With