REDUX: Cannot read properties of undefined (reading 'type')

Hi :sweat_smile:

I’m having issues figuring out what I’ve missed out here, for some reason my actions aren’t being picked up once they’re sent through the reducers upon store creation.

Where do I need to look at when this type of error comes up? my actions are set up like so:

actions/index.js

import { 
    GET_QUOTE, 
    SEND_TWEET 
} from "../constants";

export const getQuote = () => ({ 
    type: GET_QUOTE
})

export const sendTweet = () => ({
     type: SEND_TWEET
})

/reducers/getQuote.js

import { GET_QUOTE } from "../constants";

export default function updateQuote(state = null, action) {
    switch (action.type) {
        case GET_QUOTE:
            console.log("test");
        default:
            return state;
    }
}

/reducers/sentTweet.js

import { SEND_TWEET } from "../constants";

export default function sendTweet(state = null, action) {
    switch (action.type) {
        case SEND_TWEET:
            console.log("test");
        default:
            return state;
    }
}
import { combineReducers } from "redux";
import sendTweet from "./sendTweet";
import updateQuote from "./updateQuote";

export default combineReducers({
    sendTweet,
    updateQuote
})

/store/index.js

import {createStore} from "redux";
import reducer from "../reducers/index";

const initialState = {
    quotes: {
        "name1": "lorem ipsum",
        "name2": "lorem ipsum",
        "name3": "lorem ipsum",
        "name4": "lorem ipsum",
        "name5": "lorem ipsum",

    },
    name: [
        "name1", 
        "name2", 
        "name3", 
        "name4", 
        "name5"
    ],
    colors: [
        "red",
        "black",
        "cadetblue",
        "aliceblue",
        "yellow"
    ]

}


const store = createStore(initialState, reducer);

export default store;

any help and advice is much appreciated :slight_smile: thanks!

Don