title: How to solve require is not defined?
body: <p>I followed <a href="https://github.com/manoharkhadka1/laravel-chat-app" rel="noreferrer">this tutorial</a> to create a chat app with <a href="/questions/tagged/vuejs" class="post-tag" title="show questions tagged &#39;vuejs&#39;" rel="tag">vuejs</a> and <a href="/questions/tagged/laravel" class="post-tag" title="show questions tagged &#39;laravel&#39;" rel="tag">laravel</a>.</p>
  
  <p>I get <em>require is not defined</em> error in <code>app.js:8</code>.I tried so many things but  but nothing seems to solve this problem.</p>
  
  <p>I tried using requirejs so i added these two line in my view </p>
  
  <pre><code>&lt;script type="text/javascript" data-main="{{ url('resources/assets/js/app.js')}}" src="https://requirejs.org/docs/release/2.3.5/minified/require.js"&gt;&lt;/script&gt;
  &lt;script src="{{ url('resources/assets/js/app.js')}}"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>and this is my app.js code:</p>
  
  <pre><code>requirejs.config({
  baseUrl: 'js/lib',
  paths: {
      app: '../app'
  }
  });
  
  requirejs(['jquery', 'canvas', 'app/sub'],
   function   ($,        canvas,   sub) {
  });
  // this line below is causing the problem
  require('./bootstrap');
  
  window.Vue = require('vue');
  Vue.use(require('vue-chat-scroll'));
  
  Vue.component('chat-message', require('./components/ChatMessage.vue'));
  Vue.component('chat-log', require('./components/ChatLog.vue'));
  Vue.component('user-log', require('./components/UserLog.vue'));
  Vue.component('chat-composer', require('./components/ChatComposer.vue'));
  </code></pre>