Response rendering null (\\u0) characters

2019-06-04 00:45发布

问题:

Why laravel blade view source code starts with null characters:

Route:

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

home.blade.php

<html>
   <head>
     <title>a</title>
  </head>
  <body>
    <p>ee</p>
  </body>
</html>

Output in Chrome: Console source code

View page source: Page source

A lot of white spaces added.

If I change routes to:

Route::get('/', function () {
    return response()->json(['a' => 'b']);
});

Page looks like: Web page

In addition every ajax request fails and JSON.parse exception is thrown because of \u0 characters.

I'm stuck with this totally.