My project was working fine but suddenly, without any changes, it started failing. Follow the errors:
[INFO] const TEXT_DECODER = new TextDecoder();
[INFO] ^
[INFO]
[INFO] ReferenceError: TextDecoder is not defined
[INFO] at Object.<anonymous> (C:\Users\myname\workspace\company\company-ui-app\node_modules\engine.io\build\server.js:16:22)
[INFO] at Module._compile (internal/modules/cjs/loader.js:688:30)
[INFO] at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
[INFO] at Module.load (internal/modules/cjs/loader.js:598:32)
[INFO] at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
[INFO] at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[INFO] at Module.require (internal/modules/cjs/loader.js:636:17)
[INFO] at require (internal/modules/cjs/helpers.js:20:18)
[INFO] at Object.<anonymous> (C:\Users\myname\workspace\company\company-ui-app\node_modules\engine.io\build\engine.io.js:5:18)
[INFO] at Module._compile (internal/modules/cjs/loader.js:688:30)
My application is build via maven, and it uses a plugin to compile the Javascript part through gulp. Follow below the snipped of my pom.xml that is causing this exception:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v10.12.0</nodeVersion>
<npmVersion>6.4.1</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<!-- Optional configuration which provides for running any npm command -->
<configuration>
<arguments>install --verbose</arguments>
</configuration>
</execution>
<execution>
<id>gulp compile --prod</id>
<phase>generate-resources</phase>
<goals>
<goal>gulp</goal>
</goals>
<configuration>
<arguments>compile --prod</arguments>
</configuration>
</execution>
<execution>
<id>gulp dist-compile</id>
<phase>generate-resources</phase>
<goals>
<goal>gulp</goal>
</goals>
<configuration>
<arguments>dist-compile</arguments>
</configuration>
</execution>
</executions>
</plugin>
During the execution of the npm part I got a strange output (not sure if this is related):
[INFO] npm timing audit compress Completed in 145ms
[INFO] npm info audit Submitting payload of 83059bytes
[INFO] npm http fetch POST 502 https://repo.mycompany.com/repository/npm-all/-/npm/v1/security/audits/quick 2251ms