Laravel 5 adding invalid chars at end of JS

249 views Asked by At

I'm including a JS file with the following tag in my app.blade.php:

<script type="text/javascript" language="javascript" src="/js/colors.js"></script>

Whenever that script loads in the browser, it contains a bunch of invalid characters at the end. I've verified that these characters are not present in the actual file.

Has anyone seen this problem? Do you know a workaround?

The characters don't copy successfully to this text box, they appear to have no width when copied here...

enter image description here

1

There are 1 answers

0
haakym On BEST ANSWER

It appears to be an nginx issue that can be fixed by changing sendfile on; to sendfile off; in your nginx config file: /etc/nginx/nginx.conf then restarting your server.

Answer courtesy of these links:

https://forum.phalconphp.com/discussion/1414/bug-asset-files-incomplete-on-join-or-get-characters-appended-at

https://jeremyfelt.com/2013/01/08/clear-nginx-cache-in-vagrant/