question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

store.getState is not a function

See original GitHub issue

Getting this error and unable to figure out why. Following the instructions as closely as possible:

store.getState is not a function
TypeError: store.getState is not a function
    at Object.runComponentSelector [as run] (http://localhost:3000/_next/1505232471916/commons.js:85141:46)
    at Connect.initSelector (http://localhost:3000/_next/1505232471916/commons.js:85293:23)
    at new Connect (http://localhost:3000/_next/1505232471916/commons.js:85234:15)
    at http://localhost:3000/_next/1505232471916/commons.js:29191:18
    at measureLifeCyclePerf (http://localhost:3000/_next/1505232471916/commons.js:28972:12)
    at ReactCompositeComponentWrapper._constructComponentWithoutOwner (http://localhost:3000/_next/1505232471916/commons.js:29190:16)
    at ReactCompositeComponentWrapper._constructComponent (http://localhost:3000/_next/1505232471916/commons.js:29176:21)
    at ReactCompositeComponentWrapper.mountComponent (http://localhost:3000/_next/1505232471916/commons.js:29084:21)
    at mountComponent (http://localhost:3000/_next/1505232471916/commons.js:2295:35)
    at Object._ReactReconciler2.default.mountComponent (http://localhost:3000/_next/1505232471916/commons.js:14921:35)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
codemillicommented, Nov 17, 2017

After struggle a lot, I got the reason.

If you return store In getInitialProps method, it gonna throw error when client side. you can get store object in getInitialProps for dispatch some actions, however we should not return that object.

0reactions
jhoffmcdcommented, Mar 7, 2018

@hckrmoon you saved me, was fighting with this for hours. We had a sepearte store as in retail store prop being passed that was conflicting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React store.getState is not a function - Stack Overflow
This is a typo that generated the error: TypeError: store.getState is not a function. Wrong const store = createStore(()=>[], {} ...
Read more >
TypeError: store.getState is not a function in Electron #1056
I think this is your issue: your configureStore function returns an object with properties {store, persistor} , but you're assigning const store ...
Read more >
this.props.contextValue.store.getState is not a function". I am ...
I am getting the following error when trying to use connectSearchBox() "TypeError: this.props.contextValue.store.getState is not a function" ...
Read more >
TypeError: store.getState is not a function - JavaScript
Hey, guys. I dived into React-Redux Beginners friendly guide, following the steps in the tutorial. However, I have got an error and I...
Read more >
Reactjs – Uncaught TypeError: store.getState is not a function
Reactjs – Uncaught TypeError: store.getState is not a function. reactjsredux. In my redux js app (google appengine backend), I get the following warnings ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found