Open gottfrois opened 9 years ago
The same issue! Got:
ERROR in ./~/stompjs/lib/stomp-node.js
Module not found: Error: Cannot resolve module 'net' in D:\Projects\MyProject\node_modules\stompjs\lib
when running karma tests. Without Karma all works correct. Looks like stomp-js team ignoring the problem
@gottfrois I solved this by adding
node: {
net: 'empty'
}
to my webpackConfig.js
Not sure if it's too late for this... I added a main property to the package.json of stompjs in node_module.
"main": "./lib/stomp.min.js"
this solve the issue of my situation. Hope it will help
I edit file your_path/node_modules/stompjs/index.js
, comment it like this:
var Stomp = require('./lib/stomp.js');
// var StompNode = require('./lib/stomp-node.js');
module.exports = Stomp.Stomp;
// module.exports.overTCP = StompNode.overTCP;
// module.exports.overWS = StompNode.overWS;
This repository is no longer supported by authors, isn't it? This is the only reason this issue still not fixed. Does anyone know a good fork? Or another module for stomp js?
I added an npm dependency of "net": "1.0.2" to solve the " Cannot resolve module 'net' " error.
(Using Angular 6 and Typescript)
When install the package using npm and loading it with webpack here is what I have: