title: WebpackError: TypeError: Cannot read property 'store' of null
body: <p>I'm just a newbie to programming and have just tried GatsbyJs for a few months. I ran the command &quot;gatsby build&quot;, this is the error that comes up, It works fine on &quot;gatsby develop&quot;.</p>
  <pre><code>1:24:14 AM: failed Building static HTML for pages - 12.853s
  1:24:14 AM: error Building static HTML failed for path &quot;/products/&quot;
  1:24:14 AM: 
  1:24:14 AM:   101 | 
  1:24:14 AM:   102 |     var _useReduxContext = useReduxContext(),
  1:24:14 AM: &gt; 103 |         store = _useReduxContext.store,
  1:24:14 AM:       | ^
  1:24:14 AM:   104 |         contextSub = _useReduxContext.subscription;
  1:24:14 AM:   105 | 
  1:24:14 AM:   106 |     var selectedState = useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub);
  1:24:14 AM: 
  1:24:14 AM:   WebpackError: TypeError: Cannot read property 'store' of null
  1:24:14 AM:   
  1:24:14 AM:   - useSelector.js:103 
  1:24:14 AM:     node_modules/react-redux/es/hooks/useSelector.js:103:1
  1:24:14 AM:   
  1:24:14 AM:   - index.js:12 
  1:24:14 AM:     src/components/ProductListing/index.js:12:37
  1:24:14 AM:   
  1:24:14 AM: 
  1:24:14 AM: not finished Generating image thumbnails - 85.375s
  1:24:14 AM: ​
  1:24:14 AM: ────────────────────────────────────────────────────────────────
  1:24:14 AM:   &quot;build.command&quot; failed                                        
  </code></pre>