angular-websocket icon indicating copy to clipboard operation
angular-websocket copied to clipboard

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

Open esteban-filardi opened this issue 7 years ago • 1 comments

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.

esteban-filardi avatar Jul 14 '17 19:07 esteban-filardi

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

lifecoderua avatar Oct 17 '17 14:10 lifecoderua