ABTSoftware / SciChart.JS.Examples

MIT License
84 stars 37 forks source link

SciChart references process.env which is not available in Angular application #8

Closed stephanbertl closed 3 years ago

stephanbertl commented 4 years ago

File node_modules/scichart/constants/app.js uses process.env

exports.IS_TEST_ENV = process.env.TEST_ENV === "1";

This is not (easily) available in eg Angular applications.

klishevich commented 4 years ago

Hi @stephanbertl thank you for posting this issue :). However we have not tried SciChart with Angular yet. And as long as Angular does not use Webpack there could be other problems not only with process.env. If you could provide some simple Angular example with integrated SciChart library, I would gladly take a deeper look.

stephanbertl commented 4 years ago

Hi @klishevich, actually it works well inside the Angular app. The only problem is the process.env. My temporary workaround was to globally define the process variable in the index.html

<script type="text/javascript">
    process = {
      env: {
        TEST_ENV: false
      }
    }
  </script>

It's easy to reproduce in the standard Angular template. If I find some time I can provide a full example.

klishevich commented 3 years ago

Hi @stephanbertl, we released SciChart.js version 1.0.1293, where we added the check for process variable. Moreover we created Angular with SciChart.js boilerplate project - https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-angular-scichart