1

I am trying to replicate a tutorial on vuecasts (https://laracasts.com/series/learn-vue-2-step-by-step/episodes/18).

Everything looks fine and I don't get any errors except a warning:

Resource interpreted as Document but transferred with MIME type application/json: "http://vueme.app:8000/skills"

I already tried to change content-type to text/html as suggested here: Resource interpreted as Document but transferred with MIME type application/json warning in Chrome Developer Tools

web.php:

Route::get('/', function () {
    return view('welcome');
});


Route::get('skills', function(){
return ['javascript', 'php', 'python'];
});

welcome.blade.php:

<!doctype html>
<html lang="{{ app()->getLocale() }}">
    <head>
        <meta charset="utf-8">
        <title>Laravel</title>
    </head>
    <body>

        <div id="root">
            <ul>
                <li v-for="skill in skills" v-text="skill"></li>
            </ul>
        </div>
        <script scr="https://unpkg.com/axios/dist/axios.min.js"></script>
        <script scr="https://unpkg.com/vue"></script>
        <script scr="/js/app.js"></script>
    </body>
</html>

app.js:

new Vue({
    el: '#root',
    data:{
        skills:[]
    },
    mounted(){
        axios.get('/skills').then(response => this.skills = response.data);
    }
});

What's not working?

stepbystep
  • 331
  • 1
  • 2
  • 8
  • 1
    try `return response()->json(['javascript', 'php', 'python']);` into your `web.php` – Treast Jul 25 '17 at 12:51
  • @Treast nope, same thing. Mind you, I get that warning on the 'skills' page and not on the main page – stepbystep Jul 25 '17 at 13:40
  • 1
    Possible duplicate of [Resource interpreted as Document but transferred with MIME type application/json warning in Chrome Developer Tools](https://stackoverflow.com/questions/6934393/resource-interpreted-as-document-but-transferred-with-mime-type-application-json) – Daniel Beck Jul 25 '17 at 13:57
  • @DanielBeck Already tried that before asking the question. Doesn't work. – stepbystep Jul 26 '17 at 09:57

0 Answers0