Application error after deployment on vm

I have an application ported from angular 2 to angular 5. When I deploy it locally and run it through the http-server , I received no errors.

The problem occurs when I deploy it on my vm . After deployment, when I open it in a browser, it causes the following errors:

TypeError: Object (...) is not a function in _isAndroid (forms.js: 920)

Error: not available (in promise): TypeError: Object (...) is not a function TypeError: Object (...) is not a function in _isAndroid (forms.js: 920)

The deployment process in vm is as follows:

  • Clone repository
  • Install npm packages
  • Build an app through angular-cli
  • Copy distribution folder to relative path

My machines (local and vm) have the same npm 5.8.0, @ angular-cli 1.7.3, and I do not use package-lock.json .

Finally, I must mention that before the migration I had the same deployment process.

Do you know what may be wrong?

+5
source share
2 answers

I do not believe. Static object methods are available in Node 6.x (well, not without a flag) According to the Node website, they are available in 7.x onwards.

For more information on this minimum version, see

As mentioned in ForestG, the best solution is to upgrade your virtual machine to Node 7.x or later.

0
source

It seems that the problem of minimization due to lack ; either aggressive optimization or the file is damaged, but it's hard to reason without source code.

Example:

 //without minification works ok function test() { var postTypes = new Array('hello', 'there') (function() { alert('hello there') })() } //after minification produces error Uncaught TypeError: object is not a function function test() { var postTypes = new Array('hello', 'there')(function() { alert('hello there') })() } 
0
source

Source: https://habr.com/ru/post/1276132/


All Articles