Skip to content

redux: "Cannot read property 'store' of null" on build #1652

@dmenneck

Description

@dmenneck

I'm using redux for my react-static app and experience the following error for all the specified routes during the building process:

Failed exporting HTML for URL / (__react_static_root__/src/routes/Home): Cannot read property 'store' of null

This error does not occur when executing npm run start. I guess this is related to writing universal, "node-safe" code. Does anyone know what to do about it?

Environment

System:
    OS: macOS 12.2
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 1.92 GB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 14.16.0 - /usr/local/bin/node
    npm: 8.3.1 - /usr/local/bin/npm
    Watchman: 2022.01.24.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 97.0.4692.99
    Safari: 15.3
  npmPackages:
    react: ^16.14.0 => 16.14.0 
    react-dom: ^16.14.0 => 16.14.0 
    react-hot-loader: ^4.13.0 => 4.13.0 
    react-redux: ^7.2.6 => 7.2.6 
    react-static: 7.5 => 7.5.3 
    react-static-plugin-reach-router: ^7.5.1 => 7.6.2 
    react-static-plugin-sitemap: ^7.5.1 => 7.6.2 
    react-static-plugin-source-filesystem: ^7.5.1 => 7.6.2 
    react-static-plugin-typescript: ^7.5.3 => 7.6.2 
    react-test-renderer: ^16.14.0 => 16.14.0 
  npmGlobalPackages:
    react-static: 7.6.2

Steps to Reproduce the problem

  1. Implement redux and run npm run build

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions