Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

redux

polymer

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?

like image 927
grohjy Avatar asked Jan 28 '23 02:01

grohjy


1 Answers

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.

like image 144
grohjy Avatar answered Feb 14 '23 00:02

grohjy