Browserify Bootstrap jQuery modal undefined is not a function <p>File: <code>test.jsx</code> compiles to <code>bundle.js</code> using Gulp and Browserify.</p> <p>File: <code>test.jsx</code>:</p> <pre><code>var $ = require('jquery'); $("div#addTagModal").modal("hide"); </code></pre> <p>In browser when I load the page I get this error:</p> <pre><code>Uncaught TypeError: undefined is not a function </code></pre> <p>On this line:</p> <pre><code> $("div#addTagModal").modal("hide"); </code></pre> <p>I have no clue what is wrong. :/</p> <p><code>$.ajax</code> works fine so I assume that jQuery is loaded properly.</p> <p>Bootstrap is included in html using a script tag and I have checked the ID of modal.</p> <p>I have a button that once clicked opens that modal:</p> <pre><code>&lt;button className="btn btn-success" data-toggle="modal" href="#addTagModal" type="button"&gt; &lt;i class="icon-plus"&gt;&lt;/i&gt; &lt;/button&gt; </code></pre> <p>Any ideas?</p> <p>This is my gulp task:</p> <pre><code>gulp.task('browserify', function() { gulp.src('app/assets/js/main.js') .pipe(browserify({ debug : true, transform: ['reactify'] })) .on('error', gutil.log) .pipe(rename('public/js/bundle.js')) .pipe(gulp.dest('./')) }); </code></pre> <p>And in <code>main.js</code> I have this code:</p> <pre><code>var app = require('./test.jsx'); </code></pre>