We are using Angular 5.2.0 and we recently added StompJS 2.2.3 for WS features.
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"...",
"stompjs": "^2.3.3",
},
However, since the addition, Karma tests won't load with the error :
ERROR in ./node_modules/stompjs/lib/stomp-node.js
Module not found: Error: Can't resolve 'net' in 'C:\Workspace\Projets\HAW_WEB\common\hubanywhere-angular-common\node_modules\stompjs\lib'
@ ./node_modules/stompjs/lib/stomp-node.js 14:8-22
@ ./node_modules/stompjs/index.js
@ ./src/app/common/service/stomp/stomp.service.ts
@ ./src/app/common/service/stomp/stomp.service.spec.ts
@ ./src \.spec\.ts$
@ ./src/test.ts
It seems we have to allow karma to load the native 'net' packages, but I can't find the correct configuration to place in the karma.conf.js file.
Thanks for any help.