Search code examples
reduxpolymer

"Process is not defined"-error with Polymer and Redux


When I try to use Redux with Polymer (lit Element) I got this error: "Process is not defined ad redux.js". How to solve this error?


Solution

  • I found a hack solution from Polymer's PWA Starter kits.

    Add this lines to your index.html:

    <script>
      // HACK(keanulee): The Redux package assumes `process` exists - mock it here before
      // the module is loaded.
      window.process = {
        env: {
          NODE_ENV: 'production'
        }
      };
    </script>
    

    Works like a charm.