# 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:** 16

<div class="post-metadata">

**Author:** ![marat](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/m/91b2a8/32.png) [@marat](https://forum.elixirforum.com/u/marat)\
**Post date:** [July 23, 2018, 9:27pm UTC](https://forum.elixirforum.com/t/drab-webpack-problem-uncaught-referenceerror-require-is-not-defined/14402/16 "2018-07-23T21:27:47Z")

</div>

hm, I’m adding  
`window.__socket = require("phoenix").Socket;` to `app.js`, adding

```elixir
<script src="<%= static_path(@conn, "/js/phoenix.js") %>"></script>

```

to layout, but now I get TWO same errors:

```elixir
Uncaught ReferenceError: require is not defined
    at app.js:5
(anonymous) @ app.js:5
(index):111 Uncaught ReferenceError: require is not defined
    at Object.create ((index):111)
    at (index):1085
    at (index):1089

```

I have version `0.9.1` and `--no-brunch` phoenix app.

---

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