0๐
ReferenceError: Vue is not defined at room.js:109
Just place the <script>
that loads Vue before the one that loads your app (room.js
):
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.10/vue.min.js"></script>
<script type="text/javascript" src="room.js"></script>
This simple re-ordering does eliminate the error message you complain about: https://plnkr.co/edit/d4onGB56dTpfOHrHm34c?p=preview
โit still has the same problemโ
You have to realize that in the current state, you still execute your room.js
script before the browser has parsed your HTML <body>
, hence there is no DOM yet, and new Vue({el: '#app'})
will not find anything to attach to.
Either have the new Vue
call delayed after DOM is ready, or simply move your <script>
tags to the end of your <body>
: https://plnkr.co/edit/lTziUUiE7egVr1IaynpL?p=preview
See e.g. Invariant Violation: _registerComponent(โฆ): Target container is not a DOM element
- [Vuejs]-Is it possible to use a variable at the end of "route.params." to catch several other "router.params"?
- [Vuejs]-Laravel 5.6 โ Timeout error after framework update