title: Redux Toolkit's createAsyncThunk never dispatches rejected action
body: <p>I am using Redux Toolkit's <code>createAsyncThunk</code> and <code>Axios</code> for async requests.
  Seems like rejected action is never dispatched, even though I type in an obviously wrong URL (should return a 404) as endpoint. I know there are a lot of questions related to this in StackOverflow, but there must be something that I just can't grasp because I've not been able to solve this problem for hours.</p>
  <p>This is my Redux slice file:</p>
  <pre><code>import { createSlice, createAsyncThunk } from &quot;@reduxjs/toolkit&quot;;
  import axios from &quot;axios&quot;;
  
  const name = &quot;listings&quot;;
  const initialState = {
    data: [],
    loading: false,
    error: null
  };
  
  export const fetchListings = createAsyncThunk(
    &quot;listings/requestStatus&quot;,
    async () =&gt; {
      const response = await axios.get(
        &quot;lorem-ipsum-dolor-sit-amet&quot;
        //&quot;https://jsonplaceholder.typicode.com/todos&quot;
      );
      return response.data;
    }
  );
  
  const slice = createSlice({
    name,
    initialState,
    extraReducers: (builder) =&gt; {
      builder.addCase(fetchListings.pending, (state) =&gt; {
        console.log(&quot;pending&quot;);
        state.data = [];
        state.loading = true;
        state.error = null;
      });
      builder.addCase(fetchListings.fulfilled, (state, action) =&gt; {
        console.log(&quot;fulfilled&quot;);
        state.data = action.payload;
        state.loading = false;
        state.error = null;
      });
      builder.addCase(fetchListings.rejected, (state, action) =&gt; {
        console.error(&quot;rejected&quot;);
        state.data = [];
        state.loading = false;
        state.error = action.error.message;
      });
    }
  });
  
  export const selectListings = (state) =&gt; ({
    data: state[name].data,
    loading: state[name].loading,
    error: state[name].error
  });
  export default slice.reducer;
  </code></pre>
  <p>I tryed to try/catch the Axios call and to use <code>rejectWithValue</code> helper, but nothing seems to change. This is a <a href="https://codesandbox.io/s/thirsty-hodgkin-ig1iz" rel="nofollow noreferrer">codesandbox to replicate the issue</a>. Redux slice is located in <code>store/listings</code> and causes the component <code>src/Listings</code> to fail.</p>
  <p>If you remove the lorem-ipsum... wrong uri and uncomment the jsonplaceholder endpoint, you can easily see that everything is working fine. The wrong uri was used on purpose to trigger a 404 error and get a dispatched reject action, that unfortunately is not happening at all.</p>