0

I have a Unity project compiled to WebGL I need integrate in a Meteor application but I'm getting a weird error.

I have placed all unity files inside the public folder in Meteor, but the console reports this error:

Invoking error handler due to
Uncaught SyntaxError: Unexpected token <

blob:http%3A//localhost%3A3000/2fc31e16-9294-484a-8f82-90046929515b:1 Uncaught SyntaxError: Unexpected token <

blob: protocol suppose to be a reference to an internal or in memory resource, but I don't know why, Meteor respond that petition.

If I place the files on an Apache webserver I get no error, even using the same browser, so I think there is no problem with the web gl version of the project.

In the Apache version, if I put the blob:/http... url in another tab I see a lot of JavaScript code, but in Meteor I get HTML meteor code.

Any ideas?

Ramses
  • 66
  • 1
  • 6

1 Answers1

0

sorry its late but it may help others in future. Currently when you create WebGL build its create a folder named as Release with some compressed files which are gzip files. So decompress these files using Winzip and put that on your server. As you are decompressing these files so definitely their size increases, and its a bad idea if your server serves large files definitely it will take huge amount of time to download so in this case you have to enable gz-compression on your server. How to do it? you can do it by using .htaccess file add this code inside your .htaccess file

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/octet-stream

# For Olders Browsers Which Can't Handle Compression
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>

now your server serves compress file so that's it any help leave a comment :)