reactjsapireact-reduxreact-thunk

A cross-origin error was thrown while working on asynchronous http calls using react-thunk in codesandbox.io


I am practicing on API calls using react-thunk. but i am getting the following error.

proxyConsole.js:64 Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development.

For practicing purpose i have referred this following linkReact-redux-tutorial

I have practiced the code in codesandbox.io. code will be available in codesandbox link


Solution

  • Sandbox console doesn't always gives you the full error.

    However, if you open the actual browser console, you can see the full error.

    enter image description here

    The error is that Provider is not imported properly from react-redux

    import Provider from "react-redux"; needs to be written as import { Provider } from "react-redux"; to fix the same