PatrickJS / angular-websocket

:arrow_upper_left: The missing Angular WebSocket module for connecting client applications to servers by @AngularClass
https://angularclass.github.io/angular-websocket
MIT License
1.22k stars 195 forks source link

"ReferenceError: require is not defined" using webpack 2 when running the application #121

Open esteban-filardi opened 7 years ago

esteban-filardi commented 7 years ago

Hello, I'm getting this error when running the application. I'm using webpack 2

ReferenceError: require is not defined

Here's how I import the module on index.js

import ngWebSocket from 'angular-websocket';
...
angular.module('app', [
   ...
  'ngWebSocket'
]);

I tried looking for a solution in the issues, change things on webpack.config.js, but none of the solutions worked.

lifecoderua commented 7 years ago

Check the line of error. Most probably your webpack doesn't parse angular-websocket, which utilises require. Upon parse enabling you would face #103