Which resource did the server fail to load?
May 26, 2018
21
Level 14
Laravel and Vue error
Hi, I was starting a new product and trying to use VueJS but it gives me the error
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
I'm trying to echo out message from app.js
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
window.Vue = require('vue');
/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/
Vue.component('example-component', require('./components/ExampleComponent.vue'));
const app = new Vue({
el: '#app'
data: {
message: 'Hello World'
}
});
And this is my master.blade.php file
<div id="app">
@include ('partials.navbar')
@yield ('header')
@yield ('content1')
@yield ('content2')
@include ('partials.contact')
@include ('partials.footer')
{{ message }}
</div>
Level 14
I got it to work! I had to add @ in front of {{message}}
Please or to participate in this conversation.