# Drab webpack problem - Uncaught ReferenceError: require is not defined

**URL:** <https://forum.elixirforum.com/t/drab-webpack-problem-uncaught-referenceerror-require-is-not-defined/14402>\
**Category:** Questions\
**Tags:** phoenix, drab, webpack, socket\
**Created:** [May 27, 2018, 5:16pm UTC](https://forum.elixirforum.com/t/drab-webpack-problem-uncaught-referenceerror-require-is-not-defined/14402 "2018-05-27T17:16:13Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![dokuzbir](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@dokuzbir](https://forum.elixirforum.com/u/dokuzbir)\
**Post date:** [May 28, 2018, 12:24pm UTC](https://forum.elixirforum.com/t/drab-webpack-problem-uncaught-referenceerror-require-is-not-defined/14402/6 "2018-05-28T12:24:22Z")

</div>

Sorry maybe strange question but why that didnt work ?  
I added that to app.js `window.socket = require("phoenix").Socket`  
and in drap.js i changed ` this.Socket = window.socket`  
I got that error` this.Socket is not a constructor`.

---

_[View the full topic](https://forum.elixirforum.com/t/drab-webpack-problem-uncaught-referenceerror-require-is-not-defined/14402)._
